Request extended=progress and paginate the watched/collected getters#714
Conversation
b4998ef to
b566d2c
Compare
|
I've updated main in the mean time, still needs testing, before it can be released |
|
Tested the updated main with my kodi but I just get 'Cannot connect to Trakt' when I try to reauthorize it 2026-07-10 16:22:41.369 T:8144 info : start trakt with arguments: {'action': 'auth_info'} |
Trakt's 2026 API change (enforced after 2026-06-30) stopped returning the season/episode breakdown from /sync/watched/shows unless extended=progress is sent, and force-paginated all sync endpoints. The new REST client added a pagination helper (_get_all_pages) but getShowsWatched neither requested extended=progress nor paged, so episode watched-state cannot sync; and getShowsCollected/getMoviesWatched still used a single _get, silently truncating to the first 100 items. - getShowsWatched: request extended=progress (restores the episode breakdown) and page through results via _get_all_pages. - getShowsCollected, getMoviesWatched: route through _get_all_pages. - _get_all_pages: accept optional extra query params (merged per page). - tests: extended=progress + pagination on the getters, and the params-merge in _get_all_pages. Verified against a live account: /sync/watched/shows returns 0 episodes without extended=progress and the full season/episode breakdown with it; X-Pagination-Page-Count > 1 confirms pagination is required. Refs #713 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
b566d2c to
2d2d3cb
Compare
|
Two heads-ups for anyone testing
This PR (now rebased onto the REST rewrite) fixes the |
|
Thank you for looking into this and providing fixes! I was able to test this and tv shows are being marked as watched! However, I ran into a different issue with movies, where the "watched" item doesn't exist anymore from trakt (I think it is now plays). I am not really sure what is going on here... utilities.py around line 363 is expecting "watched" and errors out here. but in tracktapi.py it is returning "plays"? There is no "watched". oh to get the authorization with trakt to work i replaced __client_id and __client_secret around line 203 of traktapi.py with the values from the old plugin I had installed in Kodi. Just below the following lines of code: Anyhow, I hope that helps, I am not sure if I missed something or did something wrong. Thanks again! I didn't test collections or other "features", I mainly use this to sync between Kodi instances and Trakt. |
|
@razzeee are there additional testers needed for release? I'm happy to volunteer for testing compiled code if needed. |
|
The more we test this, the earlier this can be released, unfortunatly, I'm struggling a bit for time right now |
What
Trakt's 2026 API change (enforced after 2026-06-30) broke the Trakt→Kodi watched-status pull:
/sync/watched/showsno longer returns the season/episode breakdown unlessextended=progressis sent, and all/syncendpoints are now force-paginated (100/page default).The new REST client added
_get_all_pages, butgetShowsWatchedcalls a bare_getwith noextended=progress(→ episode watched-state can't sync, #713), andgetShowsWatched/getShowsCollected/getMoviesWatcheddon't page (→ silently truncated to the first 100 items).Change
getShowsWatched: sendextended=progressand page via_get_all_pages.getShowsCollected,getMoviesWatched: route through_get_all_pages._get_all_pages: accept optional extra query params (merged per page).Verification (live account,
/sync/watched/showspage 1)extended=progressextended=progressrestores the breakdown;page-count=5confirms pagination is required.Note: rebased onto the REST-client rewrite (supersedes the earlier version of this PR, which targeted the pre-rewrite
traktapi.py).Refs #713. Heads-up: on currentmain, a sync still can't complete end-to-end due to a separate object-contract regression (unrelated to pagination) — reported in #715. This PR fixes the pagination/extendedhalf.🤖 Generated with Claude Code