From 31fc6c0f862635032f8d1b342fc4c141670574af Mon Sep 17 00:00:00 2001 From: twes33 <307285618+twes33@users.noreply.github.com> Date: Mon, 20 Jul 2026 23:23:36 +0200 Subject: [PATCH] Fix Trakt watched sync for enforced pagination and extended=progress Trakt now enforces pagination on /sync/watched/{type} (previously a single request returned the full history) and no longer returns season/episode progress data under extended=full for shows. Switch both sync_watched_episodes and _sync_watched_movies to get_all_pages_json (already used elsewhere for sync/ratings and sync/playback) and request extended=progress for the shows endpoint, which is the only supported way to get season data back under Trakt's new API behavior. See https://github.com/trakt/trakt-api/discussions/775 --- resources/lib/database/trakt_sync/activities.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/resources/lib/database/trakt_sync/activities.py b/resources/lib/database/trakt_sync/activities.py index ffe0d4a7..a5b9b593 100644 --- a/resources/lib/database/trakt_sync/activities.py +++ b/resources/lib/database/trakt_sync/activities.py @@ -227,7 +227,11 @@ def _fetch_hidden_section(self, section): def _sync_watched_movies(self): try: - trakt_watched = self.trakt_api.get_json("/sync/watched/movies", extended="full") + trakt_watched = list( + itertools.chain.from_iterable( + self.trakt_api.get_all_pages_json("/sync/watched/movies", ignore_cache=True) + ) + ) if len(trakt_watched) == 0: return self.insert_trakt_movies(trakt_watched) @@ -304,7 +308,13 @@ def _sync_rated_movies(self): def sync_watched_episodes(self): try: get = MetadataHandler.get_trakt_info - trakt_watched = self.trakt_api.get_json("sync/watched/shows", extended="full") + trakt_watched = list( + itertools.chain.from_iterable( + self.trakt_api.get_all_pages_json( + "sync/watched/shows", extended="progress", ignore_cache=True + ) + ) + ) if not trakt_watched: return self.insert_trakt_shows(trakt_watched)