Skip to content

sync: send a show's own rating on add_to_ratings - #320

Merged
mfederowicz merged 1 commit into
mainfrom
sync-add-ratings-nested
Oct 31, 2026
Merged

mfederowicz merged 1 commit into
mainfrom
sync-add-ratings-nested

Conversation

@mfederowicz

Copy link
Copy Markdown
Owner

Fixed

  • sync -a add_to_ratings -t shows or -t all, with an export that also holds season or episode ratings:

    • A show was sent with the rating of whichever of its items came first. An episode rated 7 could replace the show's own 9.
    • With -t shows, season ratings were dropped, and episode ratings went inside the show. Under the contract (trakt-api 87e75e5), that rates those episodes instead of the show.

    Now a show carries only its own rating and rated_at. Seasons and episodes keep going in their own lists with their ids. -t shows means show ratings only, as in the docs example.

The contract's new nested form isn't used: our exports always have season and episode ids, and the flat lists already work. rated_at was already sent for every type.

Live check on 2026-10-31: re-sending the maintainer's own ratings export (6 ratings, including a show with a rated season and episode) with -t shows and -t all got not_found empty both times, and a fresh export afterwards was identical. The case where a season or episode rating differs from the show's own is covered by a mock test, which fails without the fix.

An AI assistant (Claude Code) found the bug, wrote the fix, the tests and the live-check script, and drafted this description.

ListToItems took a show's rating and rated_at from whichever item of the show came first, so an
episode or season rating could replace the show's own. add_to_ratings also sent the nested seasons,
where Trakt now (trakt-api 87e75e5) rates those instead of the show. Shows now carry only their own
rating; season and episode ratings keep going in their own lists with their ids.
@mfederowicz
mfederowicz merged commit b83c9f6 into main Oct 31, 2026
6 checks passed
@mfederowicz
mfederowicz deleted the sync-add-ratings-nested branch October 31, 2026 01:45
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.

1 participant