Use trakt.find_episode method for syncing
@@ -136,17 +136,12 @@ def find_show_episodes(show, plex: PlexApi, trakt: TraktApi):
def for_each_show_episode(pm, tm, trakt: TraktApi):
- lookup = trakt.lookup(tm)
-
- # loop over episodes in plex db
for pe in pm.episodes():
- try:
- te = lookup[pe.season_number][pe.episode_number]
- except KeyError:
+ te = trakt.find_episode(tm, pe)
+ if te is None:
logger.warning(f"Skipping {pe}: Not found on Trakt")
continue
-
- yield tm, pe, te.instance
+ yield tm, pe, te
def sync_all(movies=True, tv=True, show=None):
