Skip to content

Commit

Permalink
warn & bypass if plex search failed
Browse files Browse the repository at this point in the history
  • Loading branch information
simonc56 committed Dec 27, 2023
1 parent 6fc42a5 commit 9fa006b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions plextraktsync/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,9 @@ def resolve_trakt(self, tm: TraktItem) -> Media:
"""Find Plex media from Trakt id using Plex Search and Discover"""
result = self.plex.search_online(tm.item.title, tm.type)
pm = self._guid_match(result, tm)
if pm is None:
logger.warning(f"Skipping '{tm.item.title}': not found on Plex Discover")
return None
return self.make_media(pm, tm.item)

def make_media(self, plex: PlexLibraryItem, trakt):
Expand Down
7 changes: 4 additions & 3 deletions plextraktsync/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,10 @@ def sync(self, walker: Walker, dry_run=False):
sync_items.append(tm)
remaining_movies_ids.remove(tm.trakt)
for movie in walker.media_from_traktlist(sync_items, title="Trakt watched movies"):
self.sync_watched(movie, dry_run=dry_run)
# Rating medias from Plex Discover not implemented yet https://github.com/pkkid/python-plexapi/issues/1137
# self.sync_ratings(movie, dry_run=dry_run)
if movie is not None:
self.sync_watched(movie, dry_run=dry_run)
# Rating medias from Plex Discover not implemented yet https://github.com/pkkid/python-plexapi/issues/1137
# self.sync_ratings(movie, dry_run=dry_run)

shows = set()
episode_trakt_ids = set()
Expand Down

0 comments on commit 9fa006b

Please sign in to comment.