Lazy load clear_collections command
MODIFY
plextraktsync/cli.py
plextraktsync/cli.py
from functools import wraps
import click
-from plextraktsync.commands.clear_collections import clear_collections
from plextraktsync.commands.info import info
from plextraktsync.commands.inspect import inspect
from plextraktsync.commands.login import login
@@ -71,6 +70,17 @@ def cache():
pass
+@command()
+@click.option('--confirm', is_flag=True, help='Confirm the dangerous action')
+@click.option('--dry-run', is_flag=True, help='Do not perform delete actions')
+def clear_collections():
+ """
+ Clear Movies and Shows collections in Trakt
+ """
+
+ pass
+
+
cli.add_command(cache)
cli.add_command(clear_collections)
cli.add_command(info)

MODIFY
plextraktsync/commands/clear_collections.py
plextraktsync/commands/clear_collections.py
from plextraktsync.logging import logger
-@click.command()
-@click.option('--confirm', is_flag=True, help='Confirm the dangerous action')
-@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 and not dry_run:
click.echo('You need to pass --confirm or --dry-run option to proceed')
return

Lazy load clear_collections command