Skip to content

fix(metadata): honor FieldImages lock during refresh - #765

Closed
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/bc-19a3d398-13ae-49f7-86ac-25dfc64252cd-a462
Closed

fix(metadata): honor FieldImages lock during refresh#765
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/bc-19a3d398-13ae-49f7-86ac-25dfc64252cd-a462

Conversation

@cursor

@cursor cursor Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A — narrow fix

Admin artwork selection (PublishArtworkSelection) appends FieldImages to locked_fields so a curated poster/backdrop/logo (or season poster / episode still) survives metadata refresh. MergeMetadata respected that lock, but mergeAndPersist still called applyBestImages afterward. On manual refresh (MergeReplaceUnlocked) that always rewrote paths; on scheduled refresh (MergeFillEmpty) a provider image with rating > 0 also rewrote them. Season/episode persist never checked the parent series lock either, so curated season posters and episode stills were replaced the same way.

User trigger: pick artwork in the admin Image Selector, then Quick or Complete Refresh (or wait for scheduled refresh).

Approach

Skip applyBestImages when FieldImages is locked (canonical item row and localization path). When the parent series has FieldImages locked, keep existing season poster / episode still paths through persistSeasonsAndEpisodes instead of merging provider artwork.

Validation

go test ./internal/metadata/ -run 'TestMergeAndPersist_RespectsFieldImagesLock|TestPersistSeasonsAndEpisodes_RespectsParentFieldImagesLock|TestBuildItemLocalizationRecordSkipsLocalCandidates' -count=1
ok  github.com/Silo-Server/silo-server/internal/metadata  0.046s

Full make lint / make test-go not run (focused package only).

Risks

Items with FieldImages locked will keep their curated artwork until the lock is cleared, even when providers publish a higher-rated poster. That is the intended lock contract.

AI Disclosure

  • Tool(s): Cursor
  • Model(s): Cursor Grok 4.5
  • Involvement: Fully AI-generated, human verified pending
  • Adversarial review: Re-checked MergeMetadata vs applyBestImages ordering; confirmed PublishArtworkSelection locks FieldImages on the item (or parent series for season/episode). Verified prepareItemImagesForQueue restores PosterSourcePath when the cached path is preserved. Also scanned watched shortcuts, audiobook fix(web): avoid duplicate audiobook playback starts #744, home refreshSignal, collection deletes, and admin secret wipe siblings of fix(storage): protect configured Cloudflare token secret #702 — no additional HIGH findings in this pass.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
Open in Web View Automation 

cursoragent and others added 2 commits August 26, 2026 05:51
Admin artwork selection locks FieldImages, but mergeAndPersist still ran
applyBestImages afterward and season/episode persist ignored the parent
lock, so Quick/Complete refresh replaced curated posters and stills.

Co-authored-by: Quick <Quick104@users.noreply.github.com>
mergeAndPersist built the in-memory item without LockedFields, so the
season/episode artwork guard never fired on Quick/Complete Refresh.
Copy locks from the existing row and assert the production call path.

Co-authored-by: Quick <Quick104@users.noreply.github.com>
@Quick104 Quick104 closed this Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants