Add method to find by episode plex object
@@ -213,6 +213,16 @@ def find_by_media(self, media: PlexLibraryItem):
return None
+ def find_episode(self, tm: TVShow, pe: PlexLibraryItem):
+ """
+ Find Trakt Episode from Plex Episode
+ """
+ lookup = self.lookup(tm)
+ try:
+ return lookup[pe.season_number][pe.episode_number].instance
+ except KeyError:
+ return None
+
def flush(self):
"""
Submit all pending data
