Add method trakt_sync_collection for unit testing
MODIFY
plex_trakt_sync/trakt_api.py
plex_trakt_sync/trakt_api.py
@@ -246,7 +246,7 @@ def submit_collection(self):
return
try:
- result = trakt.sync.add_to_collection(self.collection)
+ result = self.trakt_sync_collection(self.collection)
result = self.remove_empty_values(result)
if result:
logger.info(f"Updated Trakt collection: {result}")
@@ -280,6 +280,9 @@ def add_to_collection(self, media_type: str, item):
self.collection[media_type].append(item)
self.flush()
+ def trakt_sync_collection(self, media_object):
+ return trakt.sync.add_to_collection(media_object)
+
def remove_empty_values(self, result):
"""
Update result to remove empty changes.

Add method trakt_sync_collection for unit testing