Skip to content

sync: send hdr and handle missing metadata in add_to_collection - #323

Merged
mfederowicz merged 1 commit into
mainfrom
sync-collection-hdr-metadata
Nov 4, 2026
Merged

mfederowicz merged 1 commit into
mainfrom
sync-collection-hdr-metadata

Conversation

@mfederowicz

Copy link
Copy Markdown
Owner

Trakt's contract now documents that sync/collection add clears metadata a request leaves out (trakt/trakt-api ae20b2f). Two problems in sync -a add_to_collection:

Fixed

  • hdr from an export made with -ex metadata was never sent: no UpdateCollectedData in str/ copied Metadata.Hdr, so re-adding an export could clear the HDR format. It is now sent with the other metadata.
  • add_to_collection -t shows with an export made without -ex metadata crashed with a nil pointer error (season episodes without metadata). Those episodes are now sent without metadata.

Tests

  • str/export_list_item_test.go: hdr copied by all five methods; season episode without metadata / collected_at.
  • handlers/commons_pure_test.go: both export shapes through ConvertBytesToItemsList for add_to_collection.
  • Both fail without the fix (hdr asserts fail, shows case panics).

Live check (2026-11-04)

  • Re-adding one collected show as exported without metadata (86 episodes): existing.episodes=86, added/updated 0, not_found empty; before the fix it crashed before the request.
  • hdr is mock-tested only: no collected item on the test account has HDR set.

AI (Claude Code) traced the contract change to the bugs, wrote the fix, tests, CHANGELOG entry and the live-check script; I ran the live check.

@mfederowicz
mfederowicz merged commit cb2f009 into main Nov 4, 2026
6 checks passed
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