Unrated titles store a 0.0 rating instead of NULL #156

Closed
opened 2026-08-23 22:15:30 +01:00 by naps62-yolo · 0 comments
Owner

Found by the integration review of blitz/rich-metadata, spanning #143 and #145.

arr-meta's Movie and Series carry vote_average: f64, and #145's write
paths store it straight onto the row. TMDB reports vote_average: 0 for a title
nobody has rated — it is the absence of a rating, not a rating of zero.

So an unrated title is stored as 0.0 rather than NULL. The columns were made
nullable in #145 exactly so that "no rating yet" is representable, and this
defeats that. Nothing renders a rating yet, which is the only reason it is not
already visible: #147's search chips, #151's grid cards and the #149/#150 detail
headers would each show a confident 0.0 on any title TMDB has no votes for.

  • Make vote_average an Option<f64> in arr-meta, normalising 0.0 away at
    the edge — the same treatment non_empty already gives TMDB's "", and for
    the same reason: TMDB uses a zero value where null is meant.
  • Let that Option flow through the daemon refresh and the add paths, so an
    unrated title writes NULL.
  • A title that later gains votes must overwrite the NULL, and one whose votes
    are withdrawn must go back to NULL — the refresh already compares before
    writing, so this is about what it compares, not a new pass.

vote_count stays unstored, per #145. It is context for a detail page, which is
served live, and storing it would only be a second way to ask the same question.

Non-goal: no change to how a rating is displayed. That is each consuming issue's
own call; this one only makes "absent" expressible.

Found by the integration review of `blitz/rich-metadata`, spanning #143 and #145. `arr-meta`'s `Movie` and `Series` carry `vote_average: f64`, and #145's write paths store it straight onto the row. TMDB reports `vote_average: 0` for a title nobody has rated — it is the absence of a rating, not a rating of zero. So an unrated title is stored as `0.0` rather than `NULL`. The columns were made nullable in #145 exactly so that "no rating yet" is representable, and this defeats that. Nothing renders a rating yet, which is the only reason it is not already visible: #147's search chips, #151's grid cards and the #149/#150 detail headers would each show a confident `0.0` on any title TMDB has no votes for. - Make `vote_average` an `Option<f64>` in `arr-meta`, normalising `0.0` away at the edge — the same treatment `non_empty` already gives TMDB's `""`, and for the same reason: TMDB uses a zero value where `null` is meant. - Let that `Option` flow through the daemon refresh and the add paths, so an unrated title writes `NULL`. - A title that later gains votes must overwrite the `NULL`, and one whose votes are withdrawn must go back to `NULL` — the refresh already compares before writing, so this is about what it compares, not a new pass. `vote_count` stays unstored, per #145. It is context for a detail page, which is served live, and storing it would only be a second way to ask the same question. Non-goal: no change to how a rating is displayed. That is each consuming issue's own call; this one only makes "absent" expressible.
naps62-yolo added this to the Rich metadata milestone 2026-08-23 22:15:30 +01:00
naps62-yolo added the area/metadifficulty/easyphase/5-uitype/bug labels 2026-08-23 22:15:30 +01:00
naps62-yolo added a new dependency 2026-08-23 22:15:35 +01:00
naps62-yolo added a new dependency 2026-08-23 22:15:35 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: yolo/arr#156