TraktApi: Use queue to update watchlist/collection
MODIFY
plextraktsync/trakt/TraktApi.py
plextraktsync/trakt/TraktApi.py
@@ -187,10 +187,7 @@ def add_to_collection(self, m, pm: PlexLibraryItem, batch=False):
else:
raise ValueError(f"Unsupported media type: {m.media_type}")
- if batch:
- self.batch_collection_add.add_to_items(m.media_type, item)
- else:
- trakt.sync.add_to_collection(item)
+ self.queue.add_to_collection((m.media_type, item))
def add_to_watchlist(self, m, batch=False):
if m.media_type in ["movies", "shows"]:
@@ -201,10 +198,8 @@ def add_to_watchlist(self, m, batch=False):
)
else:
raise ValueError(f"Unsupported media type for watchlist: {m.media_type}")
- if batch:
- self.batch_watchlist_add.add_to_items(m.media_type, item)
- else:
- trakt.sync.add_to_watchlist(item)
+
+ self.queue.add_to_watchlist((m.media_type, item))
def remove_from_watchlist(self, m, batch=False):
if m.media_type in ["movies", "shows"]:
@@ -216,10 +211,7 @@ def remove_from_watchlist(self, m, batch=False):
else:
raise ValueError(f"Unsupported media type for watchlist: {m.media_type}")
- if batch:
- self.batch_watchlist_del.add_to_items(m.media_type, item)
- else:
- trakt.sync.remove_from_watchlist(item)
+ self.queue.remove_from_watchlist((m.media_type, item))
def find_by_guid(self, guid: PlexGuid):
if guid.type == "episode" and guid.is_episode:

TraktApi: Use queue to update watchlist/collection