Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: Import types from SyncPluginInterface #1915

Merged
merged 3 commits into from
Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions plextraktsync/sync/AddCollectionPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
from plextraktsync.plugin import hookimpl

if TYPE_CHECKING:
from plextraktsync.config.SyncConfig import SyncConfig
from plextraktsync.media.Media import Media
from plextraktsync.sync.Sync import Sync
from .plugin.SyncPluginInterface import Media, SyncConfig


class AddCollectionPlugin:
Expand All @@ -19,7 +17,7 @@ def enabled(config: SyncConfig):
return config.plex_to_trakt["collection"]

@classmethod
def factory(cls, sync: Sync):
def factory(cls, sync):
return cls()

@hookimpl
Expand Down
5 changes: 2 additions & 3 deletions plextraktsync/sync/ClearCollectedPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
from plextraktsync.plugin import hookimpl

if TYPE_CHECKING:
from plextraktsync.config.SyncConfig import SyncConfig
from plextraktsync.sync.plugin import SyncPluginManager
from plextraktsync.sync.Sync import Sync
from plextraktsync.trakt.TraktApi import TraktApi
from plextraktsync.trakt.types import TraktMedia

from .plugin.SyncPluginInterface import Sync, SyncConfig, SyncPluginManager


class ClearCollectedPlugin:
logger = logging.getLogger(__name__)
Expand Down
7 changes: 3 additions & 4 deletions plextraktsync/sync/LikedListsPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
from plextraktsync.plugin import hookimpl

if TYPE_CHECKING:
from plextraktsync.config.SyncConfig import SyncConfig
from plextraktsync.sync.Sync import Sync
from plextraktsync.trakt.TraktApi import TraktApi
from plextraktsync.trakt.TraktUserListCollection import \
TraktUserListCollection

from .plugin.SyncPluginInterface import (Sync, SyncConfig,
TraktUserListCollection)


class LikedListsPlugin:
Expand Down
5 changes: 1 addition & 4 deletions plextraktsync/sync/SyncRatingsPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
from plextraktsync.plugin import hookimpl

if TYPE_CHECKING:
from plextraktsync.config.SyncConfig import SyncConfig
from plextraktsync.media.Media import Media
from plextraktsync.plan.Walker import Walker
from plextraktsync.sync.Sync import Sync
from .plugin.SyncPluginInterface import Media, Sync, SyncConfig, Walker


class SyncRatingsPlugin:
Expand Down
4 changes: 1 addition & 3 deletions plextraktsync/sync/SyncWatchedPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
from plextraktsync.plugin import hookimpl

if TYPE_CHECKING:
from plextraktsync.config.SyncConfig import SyncConfig
from plextraktsync.media.Media import Media
from plextraktsync.sync.Sync import Sync
from .plugin.SyncPluginInterface import Media, Sync, SyncConfig


class SyncWatchedPlugin:
Expand Down
10 changes: 3 additions & 7 deletions plextraktsync/sync/TraktListsPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
from plextraktsync.plugin import hookimpl

if TYPE_CHECKING:
from plextraktsync.config.SyncConfig import SyncConfig
from plextraktsync.media.Media import Media
from plextraktsync.sync.Sync import Sync
from plextraktsync.trakt.TraktUserListCollection import \
TraktUserListCollection
from .plugin.SyncPluginInterface import Media, TraktUserListCollection


class TraktListsPlugin:
Expand All @@ -25,12 +21,12 @@ def __init__(self):
self.add_to_lists = None

@staticmethod
def enabled(config: SyncConfig):
def enabled(config):
# Use True for now, would need to keep in sync with other plugins
return True

@classmethod
def factory(cls, sync: Sync):
def factory(cls, sync):
return cls()

@hookimpl(trylast=True)
Expand Down
9 changes: 3 additions & 6 deletions plextraktsync/sync/WatchListPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@
from plextraktsync.plugin import hookimpl

if TYPE_CHECKING:
from plextraktsync.config.SyncConfig import SyncConfig
from plextraktsync.media.Media import Media
from plextraktsync.plan.Walker import Walker
from plextraktsync.plex.PlexApi import PlexApi
from plextraktsync.sync.Sync import Sync
from plextraktsync.trakt.TraktApi import TraktApi
from plextraktsync.trakt.TraktUserListCollection import \
TraktUserListCollection

from .plugin.SyncPluginInterface import (Media, Sync, SyncConfig,
TraktUserListCollection, Walker)


class WatchListPlugin:
Expand Down
4 changes: 2 additions & 2 deletions plextraktsync/sync/WatchProgressPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
from plextraktsync.plugin import hookimpl

if TYPE_CHECKING:
from plextraktsync.config.SyncConfig import SyncConfig
from plextraktsync.sync.Sync import Sync
from plextraktsync.trakt.TraktApi import TraktApi

from .plugin.SyncPluginInterface import Sync, SyncConfig


class WatchProgressPlugin:
logger = logging.getLogger(__name__)
Expand Down
1 change: 1 addition & 0 deletions plextraktsync/sync/plugin/SyncPluginInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from plextraktsync.plugin import hookspec

if TYPE_CHECKING:
from plextraktsync.config.SyncConfig import SyncConfig # noqa: F401
from plextraktsync.media.Media import Media
from plextraktsync.plan.Walker import Walker
from plextraktsync.sync.plugin import SyncPluginManager
Expand Down
Loading