Cache is_collected property rather collected method
MODIFY
plextraktsync/media.py
plextraktsync/media.py
@@ -68,9 +68,16 @@ def is_collected(self):
elif not self.is_episode:
raise RuntimeError(f"is_collected: Unsupported media type: {self.media_type}")
- collected = self.trakt_api.collected(self.show.trakt)
+ collected = self.show.collected
return collected.get_completed(self.season_number, self.episode_number)
+ @cached_property
+ def collected(self):
+ if self.media_type != "shows":
+ raise RuntimeError(f"show_collected: Unsupported media type: {self.media_type}")
+
+ return self.trakt_api.collected(self.trakt)
+
def add_to_collection(self):
self.trakt_api.add_to_collection(self.trakt, self.plex)

MODIFY
plextraktsync/trakt_api.py
plextraktsync/trakt_api.py
@@ -226,7 +226,6 @@ def add_to_collection(self, m, pm: PlexLibraryItem):
self.batch.add_to_collection(m.media_type, item)
- @memoize
@nocache
@rate_limit()
def collected(self, tm: TVShow):

Cache is_collected property rather collected method