Add batch to Media.add_to_collection method
MODIFY
plextraktsync/commands/watch.py
plextraktsync/commands/watch.py
@@ -97,7 +97,6 @@ def on_activity(self, activity: ActivityNotification):
if self.add_collection and not m.is_collected:
self.logger.info(f"Add to collection: {m}")
m.add_to_collection()
- self.trakt.flush()
def on_delete(self, event: TimelineEntry):
self.logger.info(f"Deleted {event.title}")

MODIFY
plextraktsync/media.py
plextraktsync/media.py
@@ -78,8 +78,8 @@ def collected(self):
return self.trakt_api.collected(self.trakt)
- def add_to_collection(self):
- self.trakt_api.add_to_collection(self.trakt, self.plex)
+ def add_to_collection(self, batch=False):
+ self.trakt_api.add_to_collection(self.trakt, self.plex, batch=batch)
def remove_from_collection(self):
self.trakt_api.remove_from_library(self.trakt)

MODIFY
plextraktsync/sync.py
plextraktsync/sync.py
@@ -89,7 +89,7 @@ def sync_collection(self, m: Media, dry_run=False):
logger.info(f"To be added to collection: {m}")
if not dry_run:
- m.add_to_collection()
+ m.add_to_collection(batch=True)
def sync_ratings(self, m: Media, dry_run=False):
if not self.config.sync_ratings:

Add batch to Media.add_to_collection method