Catch early on a valid provider
MODIFY
plex_trakt_sync/commands/sync.py
plex_trakt_sync/commands/sync.py
@@ -95,13 +95,9 @@ def for_each_pair(sections, trakt: TraktApi):
for section in sections:
with measure_time(f"Processing section {section.title}"):
for pm in section.items():
- if not pm.provider:
- logger.error(f'[{pm}]: Unrecognized GUID {pm.guid}')
- continue
-
tm = trakt.find_movie(pm)
if tm is None:
- logger.warning(f"[{pm})]: Not found from Trakt. Skipping")
+ logger.warning(f"[{pm})]: Not found on Trakt. Skipping")
continue
yield pm, tm

MODIFY
plex_trakt_sync/plex_api.py
plex_trakt_sync/plex_api.py
@@ -124,6 +124,11 @@ def items(self):
if provider in ["local", "none", "agents.none"]:
continue
+
+ if provider not in ["imdb", "tmdb", "tvdb"]:
+ logger.error(f"{item}: Unable to parse a valid provider from guid:'{item.guid}', guids:{item.guids}")
+ continue
+
result.append(item)
return result

Catch early on a valid provider