Trailer resolution endpoint keyed on a TMDB id #144

Closed
opened 2026-08-23 19:40:42 +01:00 by naps62-yolo · 0 comments
Owner

Depends on: #143

§9.6 resolves a trailer on click rather than up front, because TMDB's search
responses carry no videos and prefetching one detail call per rendered row
would put ~20 requests behind a search-as-you-type box.

That needs an endpoint keyed on a TMDB id, not a local id — the chip appears
on TMDB rows for titles that are not in the library and have no local row to
address.

GET /api/trailer?kind=movie|tv&tmdb_id=693134
  200 { "youtube_key": "...", "name": "Official Trailer" }
  404 { "error": "no trailer" }
  • Reads movie_videos / series_videos from #143, so the selection rule lives
    in one place and this handler does not re-implement it.
  • Served through arr-meta's 24h cache: the second click on the same title, by
    anyone, costs nothing upstream.
  • No TMDB key configured behaves exactly like the existing tmdb_client() path
    in arr-api/src/search.rs — 503, same error body shape.
  • A title TMDB knows but has no video for is a 404, not a 500. It is an ordinary
    outcome and the browser renders it as "no trailer", so it must be
    distinguishable from an upstream failure.

Annotate for OpenAPI like the handlers around it.

Do not start until blitz/tv-tracking is on main — it rewrites
arr-api/src/search.rs, which this sits next to.

Depends on: #143 §9.6 resolves a trailer on click rather than up front, because TMDB's search responses carry no videos and prefetching one detail call per rendered row would put ~20 requests behind a search-as-you-type box. That needs an endpoint keyed on a **TMDB id, not a local id** — the chip appears on TMDB rows for titles that are not in the library and have no local row to address. ``` GET /api/trailer?kind=movie|tv&tmdb_id=693134 200 { "youtube_key": "...", "name": "Official Trailer" } 404 { "error": "no trailer" } ``` - Reads `movie_videos` / `series_videos` from #143, so the selection rule lives in one place and this handler does not re-implement it. - Served through arr-meta's 24h cache: the second click on the same title, by anyone, costs nothing upstream. - No TMDB key configured behaves exactly like the existing `tmdb_client()` path in `arr-api/src/search.rs` — 503, same error body shape. - A title TMDB knows but has no video for is a 404, not a 500. It is an ordinary outcome and the browser renders it as "no trailer", so it must be distinguishable from an upstream failure. Annotate for OpenAPI like the handlers around it. **Do not start until `blitz/tv-tracking` is on main** — it rewrites `arr-api/src/search.rs`, which this sits next to.
naps62-yolo added this to the Rich metadata milestone 2026-08-23 19:40:42 +01:00
naps62-yolo added the area/apidifficulty/easyphase/6-tvtype/feature labels 2026-08-23 19:40:42 +01:00
naps62-yolo added a new dependency 2026-08-23 19:42:42 +01:00
naps62-yolo added a new dependency 2026-08-23 19:42:42 +01:00
naps62-yolo added a new dependency 2026-08-23 19:42:42 +01:00
naps62-yolo added phase/5-ui and removed phase/6-tv labels 2026-08-23 19:42:55 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: yolo/arr#144