metadata: featured_sync reads every rating and reports orphaned ones #340
No reviewers
Labels
No labels
audit-work
bug
docs
general-admin
major-upgrade
needs-vps-sync
new-service
on-hold
outside-work
post-podman
renovate
upstream
vps
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
mysticalsoap/docker!340
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/featured-sync-orphans"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
featured_sync.pyhas pushed "2 item(s) failed" every night since 2026-09-24 (one since 09-20). Both ids are StarTrack ratings whose movie Radarr upgraded that week: Jellyfin derives an item's id from its file path, so the new file got a new id and the rating stayed on the old one, which now 404s. The script treated that as a tag failure and re-notified nightly.While tracing it:
/Plugins/StarTrack/Recentclamps its limit to 100 server-side regardless of thelimit=5000the script asks for. With 254 ratings on the server the sync only ever saw the newest 100, so 12 items were markedfeaturedwhere 66 qualify at the 4.0 threshold.Fix
Members/{userId}/Profile, whoserecentRatingsis the user's complete list and works with a bare server API key.movie_poster_state.json's TMDB record, reported once (state/featured_sync_state.json), and dropped from the failure count.startrack_rekey.pymoves the entries across every StarTrack json file (ratings, diary, lists, watchlist, likes all key on item id). Host-side, Jellyfin stopped, since the plugin holds the files in memory and rewrites them whole on save.--dry-runonfeatured_sync.py, same asmovie_poster_sync.py.Verification
Dry run against the live server from the branch file (
docker exec -i -w /jobs/metadata metadata python3 - --dry-run < featured_sync.py):Three of the five orphans predate this week and were invisible under the 100-entry cap. The unidentified one is a 4.5-star rating dated 2026-05-04T00:00:00Z (a Letterboxd import) on an item
movie_poster_syncnever saw.startrack_rekey.pytested on synthetic ratings/diary files: dict keys anditemIdvalues both move, and a rating list already present under the new id is merged, whichever order the two keys appear in. Not run against the real files yet: that is the host-side step after merge (docker stop jellyfin, re-key with the five pairs above,docker start jellyfin).Not run live: the first non-dry run tags 51 more movies
featured, which is the media bar's rotation. If that is too many,RATING_THRESHOLD=4.5inmedia/metadata/.envgives 37.🤖 Generated with Claude Code
/Plugins/StarTrack/Recent clamps its limit to 100 server-side, so the sync only ever saw the newest 100 of 254 ratings and marked 12 items where 66 qualify. Members/{userId}/Profile carries the user's whole rating list, and it is user-scoped by route rather than by login, so it works with a bare server API key where /MyRatings returns empty. StarTrack keys ratings by Jellyfin item id, and Jellyfin hashes that id from the file path, so every Radarr upgrade leaves the rating on an id that 404s. Those were counted as tag failures and pushed a notification every night with nothing to act on. They are now split out, resolved to the current id through movie_poster_sync's TMDB record, reported once via a state file, and moved with the new startrack_rekey.py -- a host- side edit with Jellyfin stopped, because the plugin holds its json in memory and rewrites the whole file on every save. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>