remove from trakt wl even if not in plex discover
MODIFY
plextraktsync/media.py
plextraktsync/media.py
@@ -222,7 +222,6 @@ 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.item.media_type[:-1])
pm = self._guid_match(result, tm)
- if pm is not None:
return Media(pm, tm.item, plex_api=self.plex, trakt_api=self.trakt)
def _guid_match(self, candidates: List[PlexLibraryItem], tm: TraktItem) -> PlexLibraryItem:
@@ -232,5 +231,4 @@ def _guid_match(self, candidates: List[PlexLibraryItem], tm: TraktItem) -> PlexL
for provider in ["tmdb", "imdb", "tvdb"]:
if guid.provider == provider and hasattr(tm.item, provider) and guid.id == str(getattr(tm.item, provider)):
return pm
- logger.info(f"Skipping {tm.item.title} from Trakt watchlist because not found in Plex Discover")
return None

MODIFY
plextraktsync/sync.py
plextraktsync/sync.py
@@ -164,11 +164,18 @@ def sync_watched(self, m: Media, dry_run=False):
def watchlist_sync_item(self, m: Media, dry_run=False):
if self.sync_wl:
- if m.is_movie:
+ if m.media_type == "movies":
trakt_wl = self.trakt_wl_movies
else:
trakt_wl = self.trakt_wl_shows
- if m.plex.item.guid in self.plex_wl:
+ if m.plex is None:
+ if self.update_plex_wl:
+ logger.info(f"Skipping {m.trakt.title} from Trakt watchlist because not found in Plex Discover")
+ elif self.update_trakt_wl:
+ logger.info(f"Removing {m.trakt.title} from Trakt watchlist")
+ if not dry_run:
+ m.remove_from_trakt_watchlist(batch=True)
+ elif m.plex.item.guid in self.plex_wl:
if m.trakt.trakt not in trakt_wl:
if self.update_trakt_wl:
logger.info(f"Adding {m.plex.item.title} to Trakt watchlist")

MODIFY
plextraktsync/walker.py
plextraktsync/walker.py
@@ -326,8 +326,6 @@ def media_from_traktlist(self, items: List):
for media in it:
tm = TraktItem(media, trakt=self.trakt)
m = self.mf.resolve_trakt(tm)
- if not m:
- continue
yield m
def media_from_plexlist(self, items: List):

remove from trakt wl even if not in plex discover