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

MODIFY
plextraktsync/factory.py
plextraktsync/factory.py
from plextraktsync.decorators.cached_property import cached_property
-from plextraktsync.decorators.memoize import memoize
class Factory:
@@ -77,8 +76,8 @@ def sync(self):
return Sync(config, plex, trakt)
- @memoize
- def progressbar(self, **kwargs):
+ @cached_property
+ def progressbar(self):
enabled = self.run_config.progressbar
if enabled:
@@ -126,7 +125,7 @@ def walker(self):
plex = self.plex_api
trakt = self.trakt_api
mf = self.media_factory
- pb = self.progressbar()
+ pb = self.progressbar
w = Walker(plex=plex, trakt=trakt, mf=mf, config=walk_config, progressbar=pb)
return w

Change factory.progressbar to property