Change factory.media_factory to property
MODIFY
plextraktsync/commands/inspect.py
plextraktsync/commands/inspect.py
def inspect_media(id):
plex = factory.plex_api
- mf = factory.media_factory()
+ mf = factory.media_factory
print("")
pm: PlexLibraryItem = plex.fetch_item(id)

MODIFY
plextraktsync/commands/unmatched.py
plextraktsync/commands/unmatched.py
@@ -10,7 +10,7 @@ def unmatched(no_progress_bar: bool, local: bool):
ensure_login()
plex = factory.plex_api
trakt = factory.trakt_api
- mf = factory.media_factory()
+ mf = factory.media_factory
pb = factory.progressbar(config.progressbar)
wc = WalkConfig()
walker = Walker(plex, trakt, mf, wc, progressbar=pb)

MODIFY
plextraktsync/factory.py
plextraktsync/factory.py
@@ -21,7 +21,7 @@ def plex_api(self):
return plex
- @memoize
+ @cached_property
def media_factory(self):
from plextraktsync.media import MediaFactory
@@ -124,7 +124,7 @@ def walker(self):
walk_config = self.walk_config()
plex = self.plex_api
trakt = self.trakt_api
- mf = self.media_factory()
+ mf = self.media_factory
pb = self.progressbar(config.progressbar)
w = Walker(plex=plex, trakt=trakt, mf=mf, config=walk_config, progressbar=pb)
@@ -143,7 +143,7 @@ def watch_state_updater(self):
return WatchStateUpdater(
plex=self.plex_api,
trakt=self.trakt_api,
- mf=self.media_factory(),
+ mf=self.media_factory,
config=self.config(),
)

Change factory.media_factory to property