Check for mode what to clear
MODIFY
plextraktsync/commands/clear_collections.py
plextraktsync/commands/clear_collections.py
@@ -12,12 +12,15 @@ def clear_collections(confirm: bool, dry_run: bool, collection: str):
trakt = factory.trakt_api
- for movie in trakt.movie_collection:
+ movies = collection in ["all", "movies"]
+ shows = collection in ["all", "shows"]
+
+ for movie in trakt.movie_collection if movies else []:
logger.info(f"Deleting: {movie}")
if not dry_run:
trakt.remove_from_collection(movie)
- for show in trakt.show_collection:
+ for show in trakt.show_collection if shows else []:
logger.info(f"Deleting: {show}")
if not dry_run:
trakt.remove_from_collection(show)

Check for mode what to clear