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").
Summary
Functions
True when laev holds a TMDB session, i.e. ratings can be sent.
Who the stored session belongs to, or nil.
Remove your rating for an episode.
Remove your rating for a film.
Remove your rating for a whole series.
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.
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.
The anime of one season — everything that premiered in its quarter, most
popular first. Returns {:ok, results, more?} like trending/2.
What you have given this show's episodes, as {average, count} — or nil when
you haven't rated any.
Your rating for an episode, or nil when you haven't rated it.
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.
Exchange an approved request token for a session id.
The IMDb id (tt…) for a details map, or nil.
Your rating for a film, or nil when you haven't rated it.
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 a film, 0.5–10 in half steps.
Rate a whole series, 0.5–10 in half steps.
Everything you have rated, as TMDB holds it: rated("movies"),
rated("tv"), rated("tv/episodes").
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 movies and TV shows. Returns {:ok, results, more?} where more?
says whether further pages exist.
Start a login: returns {:ok, token, url}. The user opens url, approves,
and then finish_login/1 turns the token into a lasting session.
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 movies or TV shows this week — type is "movie" or "tv".
Returns {:ok, results, more?} like search/2.
Your rating for a whole series, or nil.
Functions
True when laev holds a TMDB session, i.e. ratings can be sent.
Who the stored session belongs to, or nil.
Remove your rating for an episode.
Remove your rating for a film.
Remove your rating for a whole series.
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.
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.
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.
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.
Your rating for an episode, or nil when you haven't rated it.
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.
Exchange an approved request token for a session id.
The IMDb id (tt…) for a details map, or nil.
Your rating for a film, or nil when you haven't rated it.
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 a film, 0.5–10 in half steps.
Rate a whole series, 0.5–10 in half steps.
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.
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 movies and TV shows. Returns {:ok, results, more?} where more?
says whether further pages exist.
Start a login: returns {:ok, token, url}. The user opens url, approves,
and then finish_login/1 turns the token into a lasting session.
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 movies or TV shows this week — type is "movie" or "tv".
Returns {:ok, results, more?} like search/2.
Your rating for a whole series, or nil.