Add --dry-run option to clear_collections command
MODIFY
plex_trakt_sync/commands/clear_collections.py
plex_trakt_sync/commands/clear_collections.py
@click.command()
@click.option('--confirm', is_flag=True, help='Confirm the dangerous action')
-def clear_collections(confirm):
+@click.option('--dry-run', is_flag=True, help='Do not perform delete actions')
+def clear_collections(confirm, dry_run):
"""
Clear Movies and Shows collections in Trakt
"""
- if not confirm:
- click.echo('You need to pass --confirm option to proceed')
+ if not confirm and not dry_run:
+ click.echo('You need to pass --confirm or --dry-run option to proceed')
return
trakt = TraktApi()
for movie in trakt.movie_collection:
logging.info(f"Deleting: {movie}")
+ if not dry_run:
trakt.remove_from_library(movie)
for show in trakt.show_collection:
logging.info(f"Deleting: {show}")
+ if not dry_run:
trakt.remove_from_library(show)

Add --dry-run option to clear_collections command