Add plex, plex properties to Sync
MODIFY
plextraktsync/factory.py
plextraktsync/factory.py
@@ -58,8 +58,10 @@ def sync(self):
from plextraktsync.sync import Sync
config = self.config()
+ plex = self.plex_api()
+ trakt = self.trakt_api()
- return Sync(config)
+ return Sync(config, plex, trakt)
@memoize
def progressbar(self, enabled=True):

MODIFY
plextraktsync/sync.py
plextraktsync/sync.py
from plextraktsync.decorators.measure_time import measure_time
from plextraktsync.factory import logger
from plextraktsync.media import Media
+from plextraktsync.plex_api import PlexApi
+from plextraktsync.trakt_api import TraktApi
from plextraktsync.trakt_list_util import TraktListUtil
from plextraktsync.walker import Walker
@@ -51,8 +53,10 @@ def sync_watched_status(self):
class Sync:
- def __init__(self, config: Config):
+ def __init__(self, config: Config, plex: PlexApi, trakt: TraktApi):
self.config = SyncConfig(config)
+ self.plex = plex
+ self.trakt = trakt
self.update_plex_wl = self.config.trakt_to_plex["watchlist"] and not self.config.trakt_to_plex["watchlist_as_playlist"]
self.update_plex_wl_as_pl = self.config.trakt_to_plex["watchlist"] and self.config.trakt_to_plex["watchlist_as_playlist"]
self.update_trakt_wl = self.config.plex_to_trakt["watchlist"]

Add plex, plex properties to Sync