Pass scrobble_threshold to ScrobblerProxy
MODIFY
plextraktsync/commands/watch.py
plextraktsync/commands/watch.py
class ScrobblerCollection(dict):
- def __init__(self, trakt: TraktApi):
+ def __init__(self, trakt: TraktApi, threshold = 80):
super(dict, self).__init__()
self.trakt = trakt
+ self.threshold = threshold
def __missing__(self, key):
- self[key] = value = self.trakt.scrobbler(key)
+ self[key] = value = self.trakt.scrobbler(key, self.threshold)
return value
@@ -47,7 +48,7 @@ def __init__(self, plex: PlexApi, trakt: TraktApi, mf: MediaFactory, config: Con
self.trakt = trakt
self.mf = mf
self.logger = logging.getLogger("PlexTraktSync.WatchStateUpdater")
- self.scrobblers = ScrobblerCollection(trakt)
+ self.scrobblers = ScrobblerCollection(trakt, config["watch"]["scrobble_threshold"])
if config["watch"]["username_filter"]:
self.username_filter = config["PLEX_USERNAME"]
else:

MODIFY
plextraktsync/trakt_api.py
plextraktsync/trakt_api.py
@@ -166,9 +166,9 @@ def rate(self, m, rating):
m.rate(rating)
@staticmethod
- def scrobbler(media: Union[Movie, TVEpisode]) -> ScrobblerProxy:
+ def scrobbler(media: Union[Movie, TVEpisode], threshold=80) -> ScrobblerProxy:
scrobbler = media.scrobble(0, None, None)
- return ScrobblerProxy(scrobbler)
+ return ScrobblerProxy(scrobbler, threshold)
@nocache
@rate_limit()

Pass scrobble_threshold to ScrobblerProxy