Lazy load sync command
MODIFY
plextraktsync/cli.py
plextraktsync/cli.py
import click
from plextraktsync.commands.self_update import enable_self_update, self_update
-from plextraktsync.commands.sync import sync
from plextraktsync.commands.trakt_login import trakt_login
from plextraktsync.commands.unmatched import unmatched
from plextraktsync.commands.watch import watch
@@ -126,6 +125,60 @@ def plex_login():
pass
+@command()
+@click.option(
+ "--library",
+ help="Specify Library to use"
+)
+@click.option(
+ "--show", "show",
+ type=str,
+ show_default=True, help="Sync specific show only"
+)
+@click.option(
+ "--movie", "movie",
+ type=str,
+ show_default=True, help="Sync specific movie only"
+)
+@click.option(
+ "--id", "ids",
+ type=str,
+ multiple=True,
+ show_default=True, help="Sync specific item only"
+)
+@click.option(
+ "--sync", "sync_option",
+ type=click.Choice(["all", "movies", "tv", "shows"], case_sensitive=False),
+ default="all",
+ show_default=True, help="Specify what to sync"
+)
+@click.option(
+ "--batch-size", "batch_size",
+ type=int,
+ default=1, show_default=True,
+ help="Batch size for collection submit queue"
+)
+@click.option(
+ "--dry-run", "dry_run",
+ type=bool,
+ default=False,
+ is_flag=True,
+ help="Dry run: Do not make changes"
+)
+@click.option(
+ "--no-progress-bar", "no_progress_bar",
+ type=bool,
+ default=False,
+ is_flag=True,
+ help="Don't output progress bars"
+)
+def sync():
+ """
+ Perform sync between Plex and Trakt
+ """
+ pass
+
+
cli.add_command(cache)
cli.add_command(clear_collections)
cli.add_command(info)

MODIFY
plextraktsync/commands/sync.py
plextraktsync/commands/sync.py
from plextraktsync.version import version
-@click.command()
-@click.option(
- "--library",
- help="Specify Library to use"
-)
-@click.option(
- "--show", "show",
- type=str,
- show_default=True, help="Sync specific show only"
-)
-@click.option(
- "--movie", "movie",
- type=str,
- show_default=True, help="Sync specific movie only"
-)
-@click.option(
- "--id", "ids",
- type=str,
- multiple=True,
- show_default=True, help="Sync specific item only"
-)
-@click.option(
- "--sync", "sync_option",
- type=click.Choice(["all", "movies", "tv", "shows"], case_sensitive=False),
- default="all",
- show_default=True, help="Specify what to sync"
-)
-@click.option(
- "--batch-size", "batch_size",
- type=int,
- default=1, show_default=True,
- help="Batch size for collection submit queue"
-)
-@click.option(
- "--dry-run", "dry_run",
- type=bool,
- default=False,
- is_flag=True,
- help="Dry run: Do not make changes"
-)
-@click.option(
- "--no-progress-bar", "no_progress_bar",
- type=bool,
- default=False,
- is_flag=True,
- help="Don't output progress bars"
-)
def sync(
sync_option: str,
library: str,

Lazy load sync command