Repository navigation
fix(metadata): stop reading an NFO's bare rating as IMDb beside a ratings block - #2311
Conversation
…ings block Radarr writes its default source's value into the bare <rating> tag, and that source is TMDB until IMDb has a score. The parser filled the IMDb slot from that tag whenever <ratings> had no imdb entry, so new titles showed TMDB's number under the IMDb label, and because local metadata merges first, the real IMDb rating from a provider never replaced it. Use the bare <rating> as IMDb only when the NFO has no <ratings> block. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (3)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The parser output shows the changed values, but not the IMDb rating users see on title pages and cards. Please add before-and-after captures of the same title and data on the affected surfaces, naming the builds; include desktop and mobile web where affected, or explain which surfaces are unaffected, as CONTRIBUTING's “Show visible changes” requires. Please also file and link the drafted siloserver.org issue for the manual's outdated NFO rating rule; repository policy requires an open issue, not just a draft. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0a0be9e95c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // block. A writer that emits both, such as Radarr, copies its default | ||
| // source into the bare tag, and that source is TMDB until IMDb has a | ||
| // score. Reading it as IMDB would show TMDB's number under the IMDb label. | ||
| if len(block.Ratings) == 0 { |
There was a problem hiding this comment.
File the required user-manual follow-up
The commit explicitly says the user manual still documents the old fallback rule and that the website issue is only drafted, so this user-visible behavior change would merge with known-incorrect documentation. File the siloserver.org issue before merging, as required for changes that leave the manual wrong or incomplete.
AGENTS.md reference: AGENTS.md:L156-L160
Useful? React with 👍 / 👎.
| // block. A writer that emits both, such as Radarr, copies its default | ||
| // source into the bare tag, and that source is TMDB until IMDb has a | ||
| // score. Reading it as IMDB would show TMDB's number under the IMDb label. | ||
| if len(block.Ratings) == 0 { |
There was a problem hiding this comment.
Add before-and-after evidence for the displayed rating
This changes the IMDb value shown on title pages and cards, but the Evidence section contains only parser output rather than before-and-after captures of the same screen and data. Add captures for each affected client surface, including desktop and mobile web where applicable, before merging.
AGENTS.md reference: AGENTS.md:L305-L313
Useful? React with 👍 / 👎.
| // block. A writer that emits both, such as Radarr, copies its default | ||
| // source into the bare tag, and that source is TMDB until IMDb has a | ||
| // score. Reading it as IMDB would show TMDB's number under the IMDb label. | ||
| if len(block.Ratings) == 0 { |
There was a problem hiding this comment.
Track the ratings container instead of its child count
When an NFO contains an empty <ratings/> container beside a bare <rating>, encoding/xml leaves block.Ratings empty, so this condition still imports the bare value as IMDb even though the new rule says it is trusted only when no <ratings> block exists. Preserve whether the container was present, for example with a pointer or an explicit presence flag, rather than inferring presence from the number of decoded children.
Useful? React with 👍 / 👎.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Problem
Related issue: N/A
Validation tasks: none affected
New releases can show TMDB's score under the IMDb label. Radarr writes a
movie.nfowith a<ratings>block and a bare<rating>tag that repeats the block's default source. Before IMDb has a score, that default is TMDB. Silo read the bare tag as the IMDb rating whenever<ratings>had noimdbentry, so both labels showed the same number.Local metadata merges first and later providers only fill empty fields, so a real IMDb rating from MDBList could not replace the wrong one. One title showed IMDb 6.7 (TMDB's 6.667 from 6 votes) while IMDb and MDBList had 2.7. On one large library, 147 movies and 1 series store an IMDb rating equal to their TMDB rating that differs from MDBList's IMDb score by 0.2 or more, mostly recent releases.
This change reads a bare
<rating>as IMDb only when the NFO has no<ratings>block. An NFO with only the bare tag, which is what older Kodi scrapers wrote, still fills the IMDb rating. Movie, series, and episode NFOs share the same code.Approach
When the IMDb slot is empty after parsing, a provider such as MDBList fills it on the next refresh. A refresh rewrites
rating_imdbfrom the merged result, so titles already stored with the wrong value correct themselves on their next metadata refresh. This PR does not trigger refreshes.Validation
go build ./...,gofmt -l .,go vet ./...,make lint-changed(0 issues): pass.go test ./internal/metadata/...: pass. New tests cover a movie NFO and an episode NFO whose<ratings>block has only a TMDB entry beside a bare<rating>. Existing tests still cover the bare-tag-only case and a namedimdbentry winning.make test-go: every package passes exceptinternal/mediasample, where two tests that run the local ffmpeg 6.1 fail. That package does not import the NFO code.Evidence
Server-side parser change; the visible effect is the IMDb rating on title pages and cards.
parseNFODataon the original Radarr NFO's rating tags (<rating name="themoviedb" max="10" default="true"><value>6.667</value>…</rating>inside<ratings>, plus<rating>6.667</rating>):Risks
<ratings>loses its IMDb value. I have not seen a writer that does this; Kodi and Radarr name the IMDb entry inside<ratings>.<ratings>has none"). A docs issue for siloserver.org is drafted and not yet filed.Checklist
AI Disclosure
🤖 Generated with Claude Code