You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
REST-client rewrite: sync aborts with KeyError: 'watched' (object contract not populated) #715
Testing the trakt.py→REST-client rewrite on main (9385020), a manual sync aborts almost immediately in the movie sync, before shows/episodes are processed. Filing separately from #714 since it's unrelated to pagination.
Repro: deploy main with real keys + an existing OAuth token, trigger RunScript(script.trakt, action=sync).
Traceback
File "resources/lib/service.py", line 427, in run → sync.sync()
File "resources/lib/sync.py", line 69, in sync → syncMovies.SyncMovies(self, progress)
File "resources/lib/syncMovies.py", line 52, in __init__ → self.__addMoviesToTraktWatched(kodiMovies, traktMovies, 59, 69)
File "resources/lib/syncMovies.py", line 295, in __addMoviesToTraktWatched → utilities.compareMovies(...)
File "resources/lib/utilities.py", line 365, in compareMovies → if movie_col2["watched"] == 0 and movie_col1["watched"] == 1:
KeyError: 'watched'
Cause: the rewrite replaced trakt.py but left the sync consumers (syncMovies, syncEpisodes, utilities) unchanged. The old lib populated boolean flags on each object — watched (0/1), collected, and per-episode watched — which those consumers still read (compareMovies, compareEpisodes, etc.). The new _merge_object/_merge_show/TraktObject shim copies plays/last_watched_at/collected_at but doesn't set those flags, so the first comparison raises KeyError. This affects the whole return-shape contract between traktapi and the sync modules, not just the watched getters. Flagging early so it isn't mistaken for a pagination issue.
Activity
fix: Fix syncing of movie watched state from new trakt api (Issue raz…
nathanpw commentedon Jul 17, 2026
I tried to fix this in merge request #717
Merge pull request #717 from nathanpw/fix-watched-movies