Add batch option to add_to_collection, defaults off
@@ -181,7 +181,7 @@ def mark_watched(self, m, time, show_trakt_id=None):
else:
raise RuntimeError(f"mark_watched: Unsupported media type: {m.media_type}")
- def add_to_collection(self, m, pm: PlexLibraryItem):
+ def add_to_collection(self, m, pm: PlexLibraryItem, batch=False):
if m.media_type == "movies":
item = dict(
title=m.title,
@@ -197,7 +197,10 @@ def add_to_collection(self, m, pm: PlexLibraryItem):
else:
raise ValueError(f"Unsupported media type: {m.media_type}")
+ if batch:
self.batch.add_to_collection(m.media_type, item)
+ else:
+ trakt.sync.add_to_collection(item)
@nocache
@rate_limit()
