Hand-curated franchises, for the ones TMDB groups badly.
TMDB's own collections are right for most of them — John Wick, Star Wars, Jurassic Park — and those need nothing here: the app falls back to the collection and gets the same result for free. This file is only for the exceptions, where a franchise is split across several collections (Alien sits in four), where the collection is missing films (The War of the Rohirrim), or where part of it isn't a film at all (Alien: Earth is a TV series, and TMDB files it under no franchise at all).
Membership is by TMDB id, so searching any member offers the whole franchise: "order of the phoenix" finds the Harry Potter list just as "harry potter" does.
A show that ran across several years is listed one season at a time, each dated by when it aired. That is what keeps release order honest: Agents of S.H.I.E.L.D. season 1 belongs between The Avengers and Iron Man 3, not as a single 2013 row that would have someone watch seven seasons before returning to the films of 2014.
The data is read at compile time, so looking a title up costs nothing at
runtime and works offline. Editing priv/franchises.json recompiles this
module.
Summary
Functions
Every curated franchise.
Every curated franchise a title belongs to, smallest first. A film is often in two — Spider-Man is both its own franchise and part of Marvel — and both are worth offering: one is the eight films someone means, the other is the whole universe around them.
True for a list that is a filmography rather than a franchise — one to browse through, with no meaningful "and then this one".
The curated list an IMDb series id belongs to, or nil.
A curated franchise by name — how a pinned one is found again.
Every curated franchise these titles belong to, smallest first. Search results are scanned rather than just the top hit, so a franchise is still offered when the best match for the query happens to be something else.
The entries in one tier, in release order. "all" — and any franchise
without tiers — is everything.
The most specific franchise a title belongs to, or nil.
The IMDb series this title belongs to, when TMDB files it separately.
A tier's label, for a header.
Whether a franchise offers more than one way to watch it. Only the big ones need it — a catalogue of sixty-odd titles is not something to hand someone flat, while seven Middle-earth films are.
Functions
Every curated franchise.
Every curated franchise a title belongs to, smallest first. A film is often in two — Spider-Man is both its own franchise and part of Marvel — and both are worth offering: one is the eight films someone means, the other is the whole universe around them.
True for a list that is a filmography rather than a franchise — one to browse through, with no meaningful "and then this one".
The curated list an IMDb series id belongs to, or nil.
The reverse of imdb_override/2, and the answer for a search by IMDb id where
TMDB's own reverse lookup is broken: tt13207736 resolves on TMDB to an entity
that 404s when fetched, while the curated file knows exactly which four shows
it means.
A curated franchise by name — how a pinned one is found again.
Every curated franchise these titles belong to, smallest first. Search results are scanned rather than just the top hit, so a franchise is still offered when the best match for the query happens to be something else.
The entries in one tier, in release order. "all" — and any franchise
without tiers — is everything.
The most specific franchise a title belongs to, or nil.
The IMDb series this title belongs to, when TMDB files it separately.
A Netflix anthology is one series with four seasons on IMDb and four unrelated shows on TMDB — and the release scene follows IMDb. Since TMDB then carries no IMDb id for any of them, laev has nothing to ask Torrentio with and falls back to a text search that finds almost nothing: for Monsters S2E7, one release against Torrentio's fifteen.
So the curated file records what TMDB is missing, and this is how the play path asks for it — by TMDB id, so it applies however the title was reached, not only from inside the list.
A tier's label, for a header.
Whether a franchise offers more than one way to watch it. Only the big ones need it — a catalogue of sixty-odd titles is not something to hand someone flat, while seven Middle-earth films are.