# `Laev.Tmdb`
[🔗](https://github.com/alexdont/laev/blob/main/lib/laev/tmdb.ex#L1)

Minimal TMDB v3 API client — search, movie/TV details, season episodes.

Accepts either a v3 API key or a v4 read-access token (JWTs start with "eyJ").

# `account?`

True when laev holds a TMDB session, i.e. ratings can be sent.

# `account_name`

Who the stored session belongs to, or nil.

# `clear_episode_rating`

Remove your rating for an episode.

# `clear_movie_rating`

Remove your rating for a film.

# `clear_tv_rating`

Remove your rating for a whole series.

# `collection`

A TMDB collection — its own idea of a franchise, with every film in it. Right
for most series (John Wick, Pirates of the Caribbean, Jurassic Park), which is
why only the ones it gets wrong are curated by hand.

# `configured?`

# `discover_anime`

Top currently-airing anime — Japanese-language animation TV with an episode
in the recent air-date window, popularity-first. Returns
`{:ok, results, more?}` like `trending/2`.

# `discover_anime_season`

The anime of one season — everything that premiered in its quarter, most
popular first. Returns `{:ok, results, more?}` like `trending/2`.

A season is a premiere window, which is how the charts everyone reads are
built, and it keeps every row a TMDB title: playable, with a poster, and no
guesswork mapping it from somewhere else.

# `episode_average`

What you have given this show's episodes, as `{average, count}` — or nil when
you haven't rated any.

Asked of TMDB in bulk rather than episode by episode: it keeps a list of every
episode you have rated, so one request covers a whole series instead of one
per episode.

# `episode_rating`

Your rating for an episode, or nil when you haven't rated it.

# `find_imdb`

The movie or show behind an IMDb id, as a normalized title — TMDB's reverse
lookup. `{:error, :not_found}` when TMDB has nothing filed under it.

TMDB's answer here can be a ghost: an entity that `find` names but `/tv/{id}`
then 404s on. Callers have to be able to cope with the title not resolving.

# `finish_login`

Exchange an approved request token for a session id.

# `imdb_id`

The IMDb id (tt…) for a details map, or nil.

# `movie`

# `movie_rating`

Your rating for a film, or nil when you haven't rated it.

# `poster_url`

# `rate_episode`

Rate one episode, 0.5–10 in half steps — TMDB's own scale, which is what
makes rating an episode rather than a whole series possible at all.

# `rate_movie`

Rate a film, 0.5–10 in half steps.

# `rate_tv`

Rate a whole series, 0.5–10 in half steps.

# `rated`

Everything you have rated, as TMDB holds it: `rated("movies")`,
`rated("tv")`, `rated("tv/episodes")`.

Paged through to the end — an account that imported a decade of IMDb ratings
has sixty-odd pages of films, and half an answer is worse than none here.
`on_page` is called with the running count, so a long fetch can say so.

# `release_dates`

# `round_half`

A score on TMDB's scale: half steps, 0.5 to 10. nil for anything outside it,
so a typo doesn't become a rating of 1.

# `search`

Search movies and TV shows. Returns `{:ok, results, more?}` where `more?`
says whether further pages exist.

# `season`

# `start_login`

Start a login: returns `{:ok, token, url}`. The user opens `url`, approves,
and then `finish_login/1` turns the token into a lasting session.

# `stingers`

Post-credit stinger flags for a movie, from TMDB's community keywords:
`{during_credits?, after_credits?}`. `{false, false}` on any failure —
absence of a tag means "probably none", not certainty.

# `trending`

Trending movies or TV shows this week — `type` is `"movie"` or `"tv"`.
Returns `{:ok, results, more?}` like `search/2`.

# `tv`

# `tv_rating`

Your rating for a whole series, or nil.

# `year`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
