Skip to content

feat(metadata): read the NFO fields Silo has a place for - #2317

Merged
Quick104 merged 4 commits into
mainfrom
feat/nfo-field-coverage
Oct 12, 2026
Merged

Quick104 merged 4 commits into
mainfrom
feat/nfo-field-coverage

Conversation

@Quick104

@Quick104 Quick104 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: #216
Validation tasks: changes #1143 C1 C5, #1144 C1 C2 C4 C5, Silo-Server/silo-apple#307 C1 C2 C4 C5, Silo-Server/silo-apple#308 C1 C2 C4 C5, Silo-Server/silo-android#317 C1 C2 C4 C5, Silo-Server/silo-android#318 C1 C2 C4 C5 (person credits and photos); changes Silo-Server/silo-android#313 C1 C2, Silo-Server/silo-android#314 C1 C2, Silo-Server/silo-apple#303 C1 C2, Silo-Server/silo-apple#304 C1 C2 (season and episode air dates). All minor, and only for titles whose NFO carries the new fields.

NFO files written by Kodi, Jellyfin, tinyMediaManager, or Radarr carry more than Silo reads. The reader dropped sort titles, show status, writers, trailers, named ratings and their votes, actor IDs and photos, season names and dates, episode IDs, and the artwork the file names, even though Silo has a field for each. "Use my NFO" therefore still lost that data, and remote providers filled the gaps with their own values. Jellyfin reads most of these. This change reads them into the fields Silo already has.

Approach

The NFO provider (internal/metadata/nfo) now reads:

  • <sorttitle>, tvshow <status> (through NormalizeShowStatus), <originallanguage> when it is a language code, <outline> when there is no <plot>, <certification> when there is no <mpaa> (its first country-tagged rating, so US:PG-13 / GB:12A gives PG-13), and <runtime> written as "117 min" or "1h 57m". <language> is not read: Jellyfin and Emby write the library's metadata language there.
  • <writer> alongside <credits>. Genre, studio, country, director, and writer elements are split on Kodi's /. A show's <studio> also fills its networks.
  • <trailer> as a YouTube or Vimeo video, from Kodi's YouTube add-on links and from web links. Links to other sites are dropped, because a video is stored as a site and key and clients only play the sites they know.
  • Named <rating> entries with their <votes>. IMDb, TMDB, and Rotten Tomatoes fill their rating columns. Sources beyond IMDb and TMDB also become rating-source rows, and the provider now declares Metacritic, Trakt (a percentage), TVDB, and Letterboxd next to Rotten Tomatoes. IMDb and TMDB get no rows from the NFO, because those rows hold the vote counts discovery ranks by and an NFO's votes are frozen or missing. The bare <rating> keeps fix(metadata): stop reading an NFO's bare rating as IMDb beside a ratings block #2311's rule (IMDb only without a <ratings> block), so default="true" needs no handling of its own. Jellyfin's <criticrating> is the Rotten Tomatoes critics score.
  • Episode <uniqueid>s as the episode's provider IDs, unless one file describes or serves several episodes or declares numbers other than the filename's. Episode air dates fall back from <aired> to <premiered> and <releasedate>. Episode Rotten Tomatoes ratings are read but not stored: episodes have no column for them, and adding one would need a schema, API, and client change for a value no provider supplies per episode.
  • tvshow <namedseason> as a season's title when its season.nfo gives none, and season.nfo <seasonname>, <premiered>, and <aired>.
  • <actor> <type> (GuestStar and the other kinds), <sortorder>, <tmdbid>, <imdbid>, <tvdbid>, and <thumb>.
  • <thumb aspect="...">, <fanart><thumb>, a tvshow's <thumb season="N">, and an episode's <thumb> for the poster, logo, backdrop, season poster, and episode still. Banner, clear art, disc, key art, and landscape references are parsed but have no slot yet; nfoArtImageTypes is where the local image types work connects them.

Artwork and photos an NFO names are local metadata, below sidecar files and above remote providers:

  • A local path must stay inside the item's folders, also with symlinks resolved, and pass the sidecar file checks. It becomes a file:// source with fix(metadata): find local artwork the way Kodi and Jellyfin name it, and keep it #2300's size and modification-time fingerprint, like a sidecar.
  • A URL becomes an nfo+https:// source (metadata.LocalMetadataURLSource). The NFO's author is not a trusted provider, so the URL is handled like a sidecar file: it stays in *_source_path until the image cache downloads it through its public-address guard, so clients, Discord embeds, and jellycompat's image proxy never fetch it directly. Like other local art, it is not used while metadata.cache_images is off.
  • The provider offers NFO-named art only for slots with no sidecar file, and local sources outrank remote ones in applyBestImages and in the season and episode merges. A cached copy of an NFO URL (an nfo/ key) counts as library art like a sidecar copy (artworkkey.IsLocal): localized provider art does not replace it, and a fill-empty refresh that could not read the NFO keeps it.
  • People are shared across titles, so a title's NFO photo only fills a gap: the person takes it when they have no photo at all, or when their current photo came from the same NFO folder. A provider photo, even one not cached yet, stays: the claim compares the stored photo path and source, so a provider photo that lands in between wins. A person refresh keeps a cached NFO photo. Person photo jobs carry the title's content ID so the processor confines a local read to that title's library roots; a title's interactive artwork refresh leaves them out of its scope.

Merging credits now matches a provider ID, else a name, within one role group (the cast as one group, each crew kind on its own). Before, a person credited as both actor and director lost the director credit once the NFO gave the actor credit an ID, and an NFO actor without IDs stayed a second credit beside the provider's guest star of the same name. #2298's credit enrichment, which fills NFO credits from a remote provider's, uses the same matching, so a remote writer credit no longer fills an NFO director credit's fields.

No API schema changes. The values reach /api/v2, /api/v1, and jellycompat through fields that already exist (trailers as RemoteTrailers, episode ProviderIds, person images), so Apple and Android need no change.

Validation

  • Go, at 659b3d4: build, gofmt, go vet, and make lint-changed are clean. make test-go passes apart from two internal/mediasample real-ffmpeg tests that fail the same way on the parent branch with this host's ffmpeg; CI's Go tests pass.
  • Database: the new TestPersonClaimPhotoSourcesPostgres (added to db-contracts.txt) and the full contract list pass on a freshly migrated Postgres at 659b3d4. The DB pins, run before the rebase, passed apart from TestLogPartitionsMatchPartmanOnNonUTCServer in internal/database, which this change does not touch.
  • Contracts and hygiene: the verify-apiv2-* checks, route inventory, migration ledger, scenario catalogs, offline routes, playback fixtures, local paths, and case collisions pass. verify-settings-bindings-web and the web checks were not run here (no web install); the change touches no settings or web/ files.
  • Tests cover each element, the / splitting, the rating combinations, namedseason against season.nfo, episode IDs reaching the episode row, actor IDs, actor photos from local paths and URLs with the URL and path guards, the person-photo claim rules, and NFO art against a sidecar file and against a remote provider.
  • Live: on an isolated sandbox with the TMDB and TVDB plugins and image caching on, a Kodi-style fixture library (an NFO-only movie, two real TMDB titles, an NFO-only show with two seasons) was scanned with the same steps on fix(metadata): read real-world NFO files and their id forms #2302's head ec284e80e, which includes fix(metadata): find local artwork the way Kodi and Jellyfin name it, and keep it #2300, and on this branch's head 659b3d436. Before, the pages showed none of the fields above, Ann Director / Bob Director as one person, the guest star as an actor, TMDB's art for Big Buck Bunny, no series poster, and "Season 2". After, they show the sort title, status, networks, split lists, PG-13, the trailer, the NFO poster and URL backdrop over TMDB's, Sintel's sidecar poster still over its NFO poster URL, the tvshow.nfo series and season posters, season and episode names, dates, and stills, and both actor photos. The API and database excerpts show the rating sources with votes and the episode IDs. Every image-cache job succeeded, and local sources carry fix(metadata): find local artwork the way Kodi and Jellyfin name it, and keep it #2300's fingerprint.
  • Reviews: /simplify after each change; /code-review (high) on 7a81ea6 and again on 5a84c4d after the rebase onto fix(metadata): find local artwork the way Kodi and Jellyfin name it, and keep it #2300; Codex adversarial reviews on 932817c and 5a84c4d; the Codex connector on each push. 16 findings fixed, 10 dismissed with reasons, 1 handed to fix(metadata): read real-world NFO files and their id forms #2302 as older than this PR.
    • First code review: 6 fixed (country-tagged <certification>, aspect-less TVDB banners taken for posters, actor and guest-star credits for one ID kept apart, an episode ratings comment, folder symlinks resolved per reference, decimal vote counts); 3 dismissed: a frozen <status> and an NFO photo that only fills a gap are the precedence decisions above, and the duplicate file:// parsing, which the rebase replaced with fix(metadata): find local artwork the way Kodi and Jellyfin name it, and keep it #2300's localImageSourceFilePath.
    • Second code review: 5 fixed (localized provider art replaced cached NFO URL art; a fill-empty refresh that could not read the NFO dropped that art; the person photo claim missed a provider photo written in between; credits matched by name only within one kind; folder symlinks were resolved again for every episode); 5 dismissed: a person refresh racing the photo job (both outcomes follow the gap-filling rule), the artwork storage sweep not listing nfo/ (it lists only local/, tmdb/, and tvdb/, and the artwork GC reclaims replaced copies), case-sensitive NFO paths (read as written, as Kodi does), actor photo checks while caching is off (caching is on by default, and URL photos need no file access), and two NFOs in one folder naming different photos for one actor (rare; the same-folder rule lets a photo renamed in the NFO's folder replace the old one).
    • Codex adversarial reviews: the first found that a targeted episode refresh could give a multi-episode video's NFO ids to one episode; the second found the localization problem above. Both are fixed.
    • Codex connector: 7 findings. 4 fixed (an unreadable tvshow.nfo now stops a replacing season refresh; a stale tvshow.nfo in a root that has lost the show's files no longer names seasons; a claimed NFO photo whose cache job was never enqueued is queued again on the next refresh; a director or writer listed both as a typed <actor> and in its crew tag is one credit), 1 older than this PR (calendar-invalid item dates in firstDate, passed to fix(metadata): read real-world NFO files and their id forms #2302), 2 answered in their threads (NFO URL art recovers on refresh like sidecar art; a concurrent person refresh can win over an NFO photo claim, which the gap-filling rule allows).
    • An earlier multi-agent review round led to the nfo+ source handling, the episode-ID guards, the IMDb and TMDB rows staying out of the rating sources, and the role-group credit matching.

Evidence: https://evidence.siloserver.org/r/silo-server/nfo-field-coverage/

Risks

  • NFO values win over remote ones, as for every NFO field. A tvshow <status> or rating captured when the file was written stays until the file changes, and fill-empty refreshes keep values already stored.
  • A new source scheme, nfo+https://. Code that branches on source schemes should treat it as local through isLocalImageSourcePath. The open local art copy work keys its copier on file:// only, so these sources keep the download path.

Follow-ups

AI Disclosure

  • Harness: Claude Code in T3 Code
  • Tool(s): Claude Code subagents for code review; Codex through T3 Code delegate_task for the adversarial review; the Codex GitHub connector's automatic review
  • Model(s): claude-opus-5-5 (implementation and review), claude-sonnet-5-5 (one review pass and the validation check), gpt-6.1-sol (Codex adversarial review)
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: Codex (gpt-6.1-sol, high reasoning, through T3 Code) reviewed the diff read-only twice. At 932817c it attacked nfo+ source handling across every caller, the image-cache jobs, retries and races, client and jellycompat exposure, and the parsers, and found that a targeted episode refresh could give a multi-episode video's NFO ids to one episode. At 5a84c4d, after the rebase onto fix(metadata): find local artwork the way Kodi and Jellyfin name it, and keep it #2300, it attacked how NFO art fits fix(metadata): find local artwork the way Kodi and Jellyfin name it, and keep it #2300's local-art rules and found that localized provider art replaced cached NFO URL art. Both are fixed with tests. Claude Code subagents reviewed the diff for line-level bugs, callers, contracts, failure modes, and cleanup before opening and after the rebase; their confirmed findings are fixed as listed under Validation.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 3 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 609b44d5-88d9-4ee1-92c9-6c7d641764ed

📥 Commits

Reviewing files that changed from the base of the PR and between 6dc5163 and 91aebcd.


📒 Files selected for processing (37)
  • docs/architecture/local-nfo-metadata.md
  • docs/catalog-api.md
  • internal/artworkkey/artworkkey.go
  • internal/artworkkey/artworkkey_test.go
  • internal/catalog/localize_test.go
  • internal/catalog/person_local_photo.go
  • internal/catalog/person_local_photo_db_test.go
  • internal/metadata/artwork_reconcile.go
  • internal/metadata/image_cache_job_repo.go
  • internal/metadata/image_cache_processor.go
  • internal/metadata/image_cache_processor_local_test.go
  • internal/metadata/local_artwork_precedence.go
  • internal/metadata/local_metadata_sources.go
  • internal/metadata/local_metadata_sources_test.go
  • internal/metadata/local_person_photos.go
  • internal/metadata/local_person_photos_test.go
  • internal/metadata/merge.go
  • internal/metadata/nfo/art.go
  • internal/metadata/nfo/art_test.go
  • internal/metadata/nfo/field_coverage_test.go
  • internal/metadata/nfo/images.go
  • internal/metadata/nfo/lookup.go
  • internal/metadata/nfo/nfo.go
  • internal/metadata/nfo/people.go
  • internal/metadata/nfo/provider.go
  • internal/metadata/nfo/provider_test.go
  • internal/metadata/nfo/rating_sources_test.go
  • internal/metadata/nfo/ratings.go
  • internal/metadata/nfo/series_depth.go
  • internal/metadata/nfo/series_depth_test.go
  • internal/metadata/nfo/trailer.go
  • internal/metadata/nfo_art_retention_test.go
  • internal/metadata/nfo_field_coverage_test.go
  • internal/metadata/person_refresh.go
  • internal/metadata/service.go
  • internal/models/media.go
  • scripts/ci/db-contracts.txt

✨ 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 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-12T02:01:51.526305Z a02ca04 New commits
🔒 Security Review ✅ Completed 2026-10-12T02:03:21.299344Z a02ca04 New commits
ℹ️ 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-triage silo-triage Bot added enhancement New feature or request go Pull requests that update go code priority: P2 Limited scope, workaround exists, or polish stacked Base is another open PR; merge in stack order named in the body labels Oct 12, 2026

@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: 15efcd1715

ℹ️ 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".

// nonProviderImageSchemesSQL mirrors isNonProviderImageScheme for use inside
// SQL predicates: source paths with these schemes cannot be re-downloaded.
const nonProviderImageSchemesSQL = `ARRAY['s3://%', 'file://%', 'local://%', 'upload://%', 'generated://%']`
const nonProviderImageSchemesSQL = `ARRAY['s3://%', 'file://%', 'nfo+%', 'local://%', 'upload://%', 'generated://%']`

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 Requeue NFO URL artwork during cache reconciliation

Do not classify nfo+http(s):// sources as non-redownloadable. When a cached object disappears, remoteSourcePredicate consequently treats this source as local and clears the served path, while EnqueueExistingProviderArtwork applies the same exclusion and never queues a replacement. The processor already knows how to unwrap and download these URLs, so affected NFO artwork remains blank until a later metadata refresh instead of being restored by reconciliation.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Leaving this as is, deliberately. An nfo+https:// source follows the same rules as a file:// sidecar: both are local sources that are never re-downloaded by the provider sweeps, and both come back on the item's next metadata refresh. Reconciliation can't take the reset path for them, because resetSet copies the source into the served column, and an NFO-named URL must never be served directly; that is why it's in the non-provider list. So a missing cached copy is cleared and refilled by a refresh, as the architecture doc says for local art. Re-queuing local sources from the discovery sweep would be a change for sidecars and NFO URLs together, which belongs with the local-art copy work rather than this PR.

Comment thread internal/metadata/nfo/series_depth.go Resolved
Comment thread internal/catalog/person_local_photo.go Outdated
updated_at = NOW()
FROM UNNEST($1::bigint[], $2::text[], $3::text[]) AS t(id, expected, source)
WHERE people.id = t.id
AND COALESCE(people.photo_source_path, '') = t.expected

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 Preserve local photo claims across concurrent refreshes

Guard this claim against a concurrent person refresh, not only another source claim. If a person refresh reads an empty photo, this update commits the NFO source, and the refresh then finishes, execPersonUpdate writes its stale provider photo fields while checking only provider identity, overwriting the claim even though it moved first; the queued local job then sees a mismatched source and skips. This race is possible across ordinary cluster workers and defeats the documented first-writer behavior.

AGENTS.md reference: AGENTS.md:L13-L18

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The race is real, but its outcome is one the precedence rule already allows, so I'm leaving the code as is. The NFO photo only fills a gap, and a provider photo stays.

  • If the concurrent person refresh found a provider photo, the person ends with that photo. Its own job caches it, and the NFO job sees a different source and is skipped, which is the same state a refresh that ran first would leave.
  • If the refresh found no photo, it writes the empty value it read, the NFO job is skipped, and the person has no photo until the title's next refresh. That refresh sees no photo and claims the NFO photo again.

Neither case leaves a wrong or stuck photo. Making the refresh's photo write a compare-and-set as well would change the shared person refresh path, and I'd keep that out of this PR.

@Quick104
Quick104 force-pushed the feat/nfo-field-coverage branch from 15efcd1 to 932817c Compare October 12, 2026 00:38
@Quick104
Quick104 force-pushed the fix/nfo-parser-robustness branch from 648c219 to 6c415f8 Compare October 12, 2026 00:43

@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: 932817c37b

ℹ️ 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".

@Quick104 Quick104 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Adversarial review (gpt-6.1-sol, reviewed 932817c)

One independently verified finding. The focused metadata and NFO package tests pass. A temporary Go overlay reproduces the targeted-refresh failure through the production NFO provider; the persistence impact was verified from source, without a database or live server run. Existing findings were excluded.

Reviewed by Codex (gpt-6.1-sol) through T3 Code for the PR author.

Comment thread internal/metadata/nfo/series_depth.go Resolved
@Quick104
Quick104 force-pushed the feat/nfo-field-coverage branch from 932817c to 20658e2 Compare October 12, 2026 00:53
Quick104 added a commit to Silo-Server/siloserver.org that referenced this pull request Oct 12, 2026
Covers Silo-Server/silo-server#2317: sort title, status, outline,
certification, runtime spellings, writers, ` / ` lists, trailers,
named ratings and votes, season and episode fields, actor IDs and
photos, and the images an NFO names.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Quick104
Quick104 force-pushed the feat/nfo-field-coverage branch from 30189da to 13d1364 Compare October 12, 2026 01:10

@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

if nfoDatePattern.MatchString(c) {
return c

P2 Badge Reject calendar-invalid NFO dates

For a movie NFO containing an impossible or sentinel date such as <premiered>0000-00-00</premiered> or 2026-02-31, this regex accepts the value and passes it through as ReleaseDate. media_items.release_date is a PostgreSQL date, so writeItem then fails and aborts the title's scan or refresh instead of ignoring only the malformed field. Validate the calendar date, not just its shape, before returning it.

ℹ️ 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".

Comment thread internal/metadata/nfo/people.go Resolved
@Quick104
Quick104 force-pushed the feat/nfo-field-coverage branch from 13d1364 to 38aeac3 Compare October 12, 2026 01:14
@Quick104

Copy link
Copy Markdown
Contributor Author

On the review's "Reject calendar-invalid NFO dates" finding (firstDate in internal/metadata/nfo/nfo.go): it is real, but it predates this pull request. firstDate and its shape-only pattern are unchanged from main, where a movie's <premiered> or a show's <aired> already flows into the item's date columns the same way. The dates this PR adds go to seasons and episodes, and the persist step parses those with time.Parse("2006-01-02") and skips a value that fails, so 2026-02-31 there is dropped without an error. I've passed the item-date case to #2302, which owns NFO parsing robustness (one bad value dropping only its field), and kept it out of this PR to avoid a conflicting change to the same function.

@Quick104
Quick104 force-pushed the feat/nfo-field-coverage branch from d975256 to 641c6e3 Compare October 12, 2026 01:17
@Quick104
Quick104 force-pushed the fix/nfo-parser-robustness branch from 04e8a1c to 78cb1b6 Compare October 12, 2026 01:20
@Quick104
Quick104 force-pushed the feat/nfo-field-coverage branch 3 times, most recently from 5d4b5a1 to d8c3f7e Compare October 12, 2026 01:46

@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: d8c3f7eca5

ℹ️ 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".

Comment thread internal/metadata/nfo/series_depth.go Resolved
@Quick104
Quick104 force-pushed the feat/nfo-field-coverage branch from d8c3f7e to a02ca04 Compare October 12, 2026 01:57
@Quick104
Quick104 force-pushed the fix/nfo-parser-robustness branch from 488a457 to ec284e8 Compare October 12, 2026 02:08
@Quick104
Quick104 force-pushed the feat/nfo-field-coverage branch from a02ca04 to 1e81eb9 Compare October 12, 2026 02:20

@Quick104 Quick104 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Adversarial review, round 2 (gpt-6.1-sol, reviewed 5a84c4d)

One independently verified finding. Focused NFO, metadata, and catalog artwork tests pass. A temporary Go overlay reproduces cached NFO URL posters losing precedence in both item and season localization. Cache attribution and the catalog read paths were checked against the source; no database or live server run.

Reviewed by Codex (gpt-6.1-sol) through T3 Code for the PR author.

@Quick104
Quick104 force-pushed the feat/nfo-field-coverage branch from 659b3d4 to 7972909 Compare October 12, 2026 12:42
Base automatically changed from fix/nfo-parser-robustness to main October 12, 2026 15:06
Quick104 and others added 4 commits October 12, 2026 11:09
Kodi- and Jellyfin-written NFO files carry sort titles, show status,
writers, trailers, named ratings with votes, actor ids and photos,
season names and dates, episode ids, and artwork references that the
reader dropped. Read them into the slots that already exist:

- sort title, show status, original language, outline, certification,
  runtime strings, writers, Kodi's " / " list separator, and a show's
  studios as its networks;
- trailers as YouTube or Vimeo videos, including Kodi's add-on links;
- named ratings and votes as rating sources, with <rating default> and
  the legacy <rating> attributed to the right source;
- episode <uniqueid>s and air-date fallbacks, <namedseason> titles and
  season.nfo air dates;
- actor ids, kinds, and photos, applied to a person only when they have
  no cached photo or it came from the same NFO;
- <thumb>/<fanart> artwork for the existing slots, below sidecar files
  and above remote providers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- A cached copy of an image URL an NFO names (an nfo/ key) counts as
  library artwork: a viewer's localized provider art no longer replaces
  it, and a fill-empty refresh that could not read the NFO keeps it, as
  it keeps a sidecar copy on a share that does not answer.
- A person's NFO photo claim compares the stored photo path as well as
  the source, so a provider photo that landed after the read stays.
- Credits match by name within the role group, as they do by id: an NFO
  actor without ids and the provider's guest star are one credit.
- Folder symlinks are resolved once per request, not once per episode.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Quick104
Quick104 force-pushed the feat/nfo-field-coverage branch from 7972909 to 91aebcd Compare October 12, 2026 15:12
@silo-kody

silo-kody Bot commented Oct 12, 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 ❌

@Quick104
Quick104 merged commit 4a57432 into main Oct 12, 2026
20 checks passed
@Quick104
Quick104 deleted the feat/nfo-field-coverage branch October 12, 2026 15:50
Quick104 added a commit that referenced this pull request Oct 12, 2026
…nge detection

After #2317 a season also takes its title and poster from the show's
tvshow.nfo, and after #2321 an item fills banner, thumb, clear art and disc
art slots and extra backdrops. The sidecar reports include those files, so
an edit to any of them re-applies the level. The architecture doc lists
the two cases scans still miss: images in extrafanart/ alone, and an actor
photo replaced under the same name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Quick104 added a commit that referenced this pull request Oct 12, 2026
…anual refresh (#2303)

* feat(metadata): re-apply edited NFO files and sidecar art without a manual refresh

Scans, file-change events and the scheduled refresh now notice when a
matched item's local sidecars (NFO, poster, fanart, season and episode
files) changed since they were last applied, and re-apply them from the
local files only. Field locks still win; a changed NFO <uniqueid> runs a
manual refresh to re-anchor the item, unless an admin chose the identity
with Identify.

The sidecar reports use the NFO lookup from #2302, so they apply the same
NFO GetMetadata, GetSeasons and GetEpisodes read and fail where those fail.
With #2298 the local provider always leads its level, so every level that
has one tracks its text, artwork and identity, and the identity checks use
outranks any declared IDs that do not confirm it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs(metadata): note that file events leave sidecars at a library root to the next scan

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(metadata): re-anchor when an NFO edit replaces a dead stored ID

With dead IDs left out of the comparison, an item anchored only by a dead
TMDB ID had no stored ID for the NFO's new one to contradict, so the edit
merged its text under the old identity and stored the new ID as its
baseline. A newly declared ID now also re-anchors an item that has no live
identity left, as a refresh would.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(metadata): cover show-named seasons and new artwork slots in change detection

After #2317 a season also takes its title and poster from the show's
tvshow.nfo, and after #2321 an item fills banner, thumb, clear art and disc
art slots and extra backdrops. The sidecar reports include those files, so
an edit to any of them re-applies the level. The architecture doc lists
the two cases scans still miss: images in extrafanart/ alone, and an actor
photo replaced under the same name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(metadata): count the show NFO only for seasons it names, and replace a partly dead anchor

A season's fingerprint now includes tvshow.nfo only where GetSeasons takes
the season's title or poster from it, so an unrelated edit to the show's
NFO no longer re-applies every season, while one that starts or stops
naming a season still does. A newly declared ID that replaces a stored ID
recorded as dead now re-anchors the item even when another stored ID is
live.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Comment on lines +88 to +91
// A photo still waiting for its copy may have an older job for the
// same source marked done (one skipped while the source briefly
// moved), so it runs again.
RequeueSucceeded: !isCachedImagePath(stored[id].Path),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

kody code-review Bug high

Photo-copy jobs fail to resume when an older cached photo remains: RequeueSucceeded becomes false, finishJobWithTargetUpdate marks source-mismatch skips as succeeded, and enqueueBatchChunk rejects an unchanged succeeded job without this flag, leaving the older photo indefinitely if a same-folder replacement changes the source away and back while the intervening enqueue fails. Distinguish skipped completions from applied copies and requeue skipped jobs regardless of whether the served path is cached.

Prompt for LLM

File internal/metadata/local_person_photos.go:

Line 88 to 91:

Photo-copy jobs fail to resume when an older cached photo remains: `RequeueSucceeded` becomes false, `finishJobWithTargetUpdate` marks source-mismatch skips as succeeded, and `enqueueBatchChunk` rejects an unchanged succeeded job without this flag, leaving the older photo indefinitely if a same-folder replacement changes the source away and back while the intervening enqueue fails. Distinguish skipped completions from applied copies and requeue skipped jobs regardless of whether the served path is cached.

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

Comment on lines +291 to +296
if keepsLocalPhoto(*person) {
// A cached photo a title's NFO named outranks a provider's, as local
// artwork does on titles.
accumulator.PhotoPath = person.PhotoPath
accumulator.PhotoSourcePath = person.PhotoSourcePath
accumulator.PhotoThumbhash = person.PhotoThumbhash

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

kody code-review Bug critical

Race condition in the new local-photo preservation branch restores the snapshot loaded before provider I/O: if an NFO refresh claims photo B and the image processor caches it during that lookup, UpdateRefreshed overwrites B with photo A because its SQL guard checks only provider IDs, losing the new photo and potentially restoring a deleted cache key after the processor removes A's old prefix. Preserve the current photo columns atomically in the repository update, or guard all photo writes against the originally read photo state and retry when it changes.

Prompt for LLM

File internal/metadata/person_refresh.go:

Line 291 to 296:

Race condition in the new local-photo preservation branch restores the snapshot loaded before provider I/O: if an NFO refresh claims photo B and the image processor caches it during that lookup, `UpdateRefreshed` overwrites B with photo A because its SQL guard checks only provider IDs, losing the new photo and potentially restoring a deleted cache key after the processor removes A's old prefix. Preserve the current photo columns atomically in the repository update, or guard all photo writes against the originally read photo state and retry when it changes.

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

zZebrahz added a commit to Silo-Server/siloserver.org that referenced this pull request Oct 24, 2026
* docs: describe the NFO files and ID forms Silo reads

File names match in any case, the basename comes before movie.nfo, and
multipart movies share one NFO. A file can hold just a provider link.
More ID forms and encodings are read, and an unreadable NFO stops a
refresh instead of being treated as missing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs: say an NFO's uniqueid beats a provider ID in the folder name

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs: list the NFO fields, ratings, and artwork Silo reads

Covers Silo-Server/silo-server#2317: sort title, status, outline,
certification, runtime spellings, writers, ` / ` lists, trailers,
named ratings and votes, season and episode fields, actor IDs and
photos, and the images an NFO names.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs: move the NFO images section to the end of What gets used

The encoding, precedence, and watched-status paragraphs sat under the
images heading, so they read as part of it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs: say Silo prefers images an NFO names, in plain words

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs: say how to name NFOs in a folder of several movies

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs: make the NFO season, episode, and actor rows easier to read

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs: say any provider ID in an NFO beats one in the folder name

Silo reads an NFO's ID from <uniqueid>, the other ID elements, or a
link, and any of them replaces a folder or file name's ID when a new
item is matched.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: zZebrahz <[email protected]>
Co-authored-by: zZebrahz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update go code priority: P2 Limited scope, workaround exists, or polish stacked Base is another open PR; merge in stack order named in the body

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant