Add find_episode_guid method
@@ -237,6 +237,20 @@ def search_by_id(self, media_id: str, id_type: str, media_type: str):
return None
+ def find_episode_guid(self, tm: TVShow, guid: PlexGuid, lookup=None):
+ """
+ Find Trakt Episode from Guid of Plex Episode
+ """
+ lookup = lookup if lookup else self.lookup(tm)
+ try:
+ return lookup[guid.pm.season_number][guid.pm.episode_number].instance
+ except KeyError:
+ # Retry using search for specific Plex Episode
+ logger.warning("Retry using search for specific Plex Episode")
+ if not guid.is_episode:
+ return self.find_by_guid(guid)
+ return None
+
def find_episode(self, tm: TVShow, pe: PlexLibraryItem, lookup=None):
"""
Find Trakt Episode from Plex Episode
