Skip to content

fix(metadata): stop reading an NFO's bare rating as IMDb beside a ratings block - #2311

Merged
Quick104 merged 1 commit into
mainfrom
fix/imdb-rating-source
Oct 11, 2026
Merged

Quick104 merged 1 commit into
mainfrom
fix/imdb-rating-source

Conversation

@Quick104

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A
Validation tasks: none affected

New releases can show TMDB's score under the IMDb label. Radarr writes a movie.nfo with 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 no imdb entry, 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_imdb from 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 named imdb entry winning.
  • make test-go: every package passes except internal/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. parseNFOData on 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>):

before (main 7db317895): rating_imdb=6.667 rating_tmdb=6.667
after (this branch):     rating_imdb=0     rating_tmdb=6.667

Risks

  • An NFO written by a tool that puts the IMDb score only in the bare tag and other sources in <ratings> loses its IMDb value. I have not seen a writer that does this; Kodi and Radarr name the IMDb entry inside <ratings>.
  • The user manual's local metadata page describes the old rule ("IMDb rating, when <ratings> has none"). A docs issue for siloserver.org is drafted and not yet filed.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • The Evidence section shows every change a user can see, or says there is none.

AI Disclosure

  • Harness: Claude Code (Claude Agent SDK), running in T3 Code
  • Tool(s): Claude Code
  • Model(s): claude-opus-5-5
  • Involvement: Fully AI-generated, at a maintainer's direction; maintainer review pending

🤖 Generated with Claude Code

…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]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T23:36:23.947990Z 0a0be9e PR opened
🔒 Security Review ✅ Completed 2026-10-11T23:36:19.176117Z 0a0be9e PR opened
ℹ️ 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" or "@codex security review".

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

silo-kody Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@coderabbitai

coderabbitai Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 06149443-1b50-4ce1-8e33-87748cabc86f

📥 Commits

Reviewing files that changed from the base of the PR and between 900a9e9 and 0a0be9e.


📒 Files selected for processing (3)
  • internal/metadata/nfo/nfo.go
  • internal/metadata/nfo/nfo_test.go
  • internal/metadata/nfo/series_depth_test.go

 _______________________________________________________________________
< Your 'optimization' optimized the readability right out of existence. >
 -----------------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@silo-triage silo-triage Bot added bug Something isn't working evidence-required Needs before-and-after evidence before the Evidence check passes go Pull requests that update go code priority: P2 Limited scope, workaround exists, or polish labels Oct 11, 2026
@silo-triage

silo-triage Bot commented Oct 11, 2026

Copy link
Copy Markdown

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.

@Quick104
Quick104 merged commit cd44d3c into main Oct 11, 2026
7 of 8 checks passed
@Quick104
Quick104 deleted the fix/imdb-rating-source branch October 11, 2026 23:34

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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 {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Quick104 added a commit that referenced this pull request Oct 12, 2026
Quick104 added a commit that referenced this pull request Oct 12, 2026
Quick104 added a commit that referenced this pull request Oct 12, 2026
Quick104 added a commit that referenced this pull request Oct 12, 2026
Quick104 added a commit that referenced this pull request Oct 12, 2026
Quick104 added a commit that referenced this pull request Oct 12, 2026
Quick104 added a commit that referenced this pull request Oct 12, 2026
Quick104 added a commit that referenced this pull request Oct 12, 2026
Quick104 added a commit that referenced this pull request Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working evidence-required Needs before-and-after evidence before the Evidence check passes go Pull requests that update go code priority: P2 Limited scope, workaround exists, or polish

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant