Store poster_path, backdrop_path and rating on movies and series #145

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

Depends on: #142

§9.6 keeps rich detail out of the database and serves it through arr-meta's 24h
cache. Three fields are the deliberate exception, because the views that need
them are pure SQL: the in-library half of unified search (§9.2) and the library
view read movies and series directly, and a poster on those rows would
otherwise cost one TMDB call per row on every search.

Add to both movies and series:

poster_path    TEXT
backdrop_path  TEXT
vote_average   REAL

Nullable, no default. A title added before its first metadata refresh has no
artwork yet and the UI has to handle that anyway — TMDB has entries with no
poster at all.

  • Migration follows the numbering and the STRICT convention already in
    crates/arr-db/migrations/. REAL is a valid STRICT column type; a rating
    is not an integer and storing it scaled would be a trap for whoever reads it
    next.
  • The daily metadata refresh in arr-daemon writes all three, alongside the
    fields it already refreshes. This is the whole point of the issue: a column
    nothing fills is worse than no column.
  • The add flows (POST /api/movies, POST /api/series, and the unified-search
    add path) fill them from the TMDB response they already hold, so a title
    added today has a poster before tomorrow's refresh.
  • vote_count is deliberately not stored. It is context for a rating on a
    detail page, which is served live, not something the library grid shows.

Regenerate the sqlx query data — several queries are SELECT-listed by hand.

Non-goal: no backfill job for titles already in the library. The daily refresh
reaches every one of them within a day and a one-off job would be dead code by
the end of the week.

Depends on: #142 §9.6 keeps rich detail out of the database and serves it through arr-meta's 24h cache. Three fields are the deliberate exception, because the views that need them are pure SQL: the in-library half of unified search (§9.2) and the library view read `movies` and `series` directly, and a poster on those rows would otherwise cost one TMDB call per row on every search. Add to both `movies` and `series`: ``` poster_path TEXT backdrop_path TEXT vote_average REAL ``` Nullable, no default. A title added before its first metadata refresh has no artwork yet and the UI has to handle that anyway — TMDB has entries with no poster at all. - Migration follows the numbering and the `STRICT` convention already in `crates/arr-db/migrations/`. `REAL` is a valid STRICT column type; a rating is not an integer and storing it scaled would be a trap for whoever reads it next. - The **daily metadata refresh in `arr-daemon` writes all three**, alongside the fields it already refreshes. This is the whole point of the issue: a column nothing fills is worse than no column. - The add flows (`POST /api/movies`, `POST /api/series`, and the unified-search add path) fill them from the TMDB response they already hold, so a title added today has a poster before tomorrow's refresh. - `vote_count` is deliberately not stored. It is context for a rating on a detail page, which is served live, not something the library grid shows. Regenerate the sqlx query data — several queries are `SELECT`-listed by hand. Non-goal: no backfill job for titles already in the library. The daily refresh reaches every one of them within a day and a one-off job would be dead code by the end of the week.
naps62-yolo added this to the Rich metadata milestone 2026-08-23 19:40:54 +01:00
naps62-yolo added the difficulty/easyarea/dbphase/6-tvtype/feature labels 2026-08-23 19:40:54 +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#145