diff --git a/plextraktsync/sync/TraktListsPlugin.py b/plextraktsync/sync/TraktListsPlugin.py index c29516cf8ef..12819fd7364 100644 --- a/plextraktsync/sync/TraktListsPlugin.py +++ b/plextraktsync/sync/TraktListsPlugin.py @@ -7,7 +7,8 @@ from plextraktsync.plugin import hookimpl if TYPE_CHECKING: - from .plugin.SyncPluginInterface import Media, TraktUserListCollection + from .plugin.SyncPluginInterface import (Media, SyncPluginManager, + TraktUserListCollection) class TraktListsPlugin: @@ -22,7 +23,7 @@ def __init__(self): @staticmethod def enabled(config): - # Use True for now, would need to keep in sync with other plugins + # Check for need is performed in init() return True @classmethod @@ -30,10 +31,13 @@ def factory(cls, sync): return cls() @hookimpl(trylast=True) - def init(self, trakt_lists: TraktUserListCollection): + def init(self, pm: SyncPluginManager, trakt_lists: TraktUserListCollection): self.trakt_lists = trakt_lists - # Skip updating lists if it's empty self.add_to_lists = not trakt_lists.is_empty + # Skip updating lists if it's empty + if trakt_lists.is_empty: + self.logger.warning("Disabling TraktListsPlugin: No lists to process") + pm.unregister(self) @hookimpl def fini(self, dry_run: bool):