Skip to content

Commit

Permalink
Fix trakt episode sync (#11908)
Browse files Browse the repository at this point in the history
  • Loading branch information
medariox authored Jan 5, 2025
1 parent 4f79d3f commit 9c82578
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions medusa/schedulers/trakt_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ def sync_trakt_episodes(self):
if not trakt_indexer:
continue

indexer_id = trakt_show['ids'].get(trakt_indexer)
indexer_id = watchlist_item['ids'].get(trakt_indexer)
indexer = indexerConfig[i]['id']
show = Show.find_by_id(app.showList, indexer, indexer_id)
if show:
Expand All @@ -601,18 +601,18 @@ def sync_trakt_episodes(self):
if not show:
# If can't find with available indexers try IMDB
trakt_indexer = get_trakt_indexer(EXTERNAL_IMDB)
indexer_id = trakt_show['ids'].get(trakt_indexer)
indexer_id = watchlist_item['ids'].get(trakt_indexer)
show = Show.find_by_id(app.showList, EXTERNAL_IMDB, indexer_id)
if not show:
# If can't find with available indexers try TRAKT
trakt_indexer = get_trakt_indexer(EXTERNAL_TRAKT)
indexer_id = trakt_show['ids'].get(trakt_indexer)
indexer_id = watchlist_item['ids'].get(trakt_indexer)
show = Show.find_by_id(app.showList, EXTERNAL_TRAKT, indexer_id)

# If can't find show add with default trakt indexer
if not show:
trakt_indexer = get_trakt_indexer(trakt_default_indexer)
indexer_id = trakt_show['ids'].get(trakt_indexer)
indexer_id = watchlist_item['ids'].get(trakt_indexer)
# Only add show if we didn't added it before
if indexer_id not in added_shows:
self.add_show(trakt_default_indexer, indexer_id, trakt_show['title'], SKIPPED)
Expand Down

0 comments on commit 9c82578

Please sign in to comment.