fix(metadata): honor FieldImages lock during refresh - #765
Closed
cursor[bot] wants to merge 2 commits into
Closed
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Related issue: N/A — narrow fix
Admin artwork selection (
PublishArtworkSelection) appendsFieldImagestolocked_fieldsso a curated poster/backdrop/logo (or season poster / episode still) survives metadata refresh.MergeMetadatarespected that lock, butmergeAndPersiststill calledapplyBestImagesafterward. On manual refresh (MergeReplaceUnlocked) that always rewrote paths; on scheduled refresh (MergeFillEmpty) a provider image withrating > 0also 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
applyBestImageswhenFieldImagesis locked (canonical item row and localization path). When the parent series hasFieldImageslocked, keep existing season poster / episode still paths throughpersistSeasonsAndEpisodesinstead of merging provider artwork.Validation
Full
make lint/make test-gonot run (focused package only).Risks
Items with
FieldImageslocked 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
Checklist