Return values for scrobble calls
MODIFY
plextraktsync/commands/watch.py
plextraktsync/commands/watch.py
@@ -151,9 +151,10 @@ def scrobble(self, m: Media, percent: float, event: PlaySessionStateNotification
return self.scrobblers[tm].pause(percent)
if state == "stopped":
- self.scrobblers[tm].stop(percent)
+ value = self.scrobblers[tm].stop(percent)
del self.scrobblers[tm]
del self.sessions[event.session_key]
+ return value
def watch():

MODIFY
plextraktsync/trakt_api.py
plextraktsync/trakt_api.py
@@ -38,7 +38,7 @@ def __init__(self, scrobbler: Scrobbler, threshold=80):
@time_limit()
def update(self, progress: float):
self.logger.debug(f'update({self.scrobbler.media}): {progress}')
- self.scrobbler.update(progress)
+ return self.scrobbler.update(progress)
@nocache
@rate_limit()
@@ -46,7 +46,7 @@ def update(self, progress: float):
def pause(self, progress: float):
self.logger.debug(f'pause({self.scrobbler.media}): {progress}')
self.scrobbler.progress = progress
- self.scrobbler.pause()
+ return self.scrobbler.pause()
@nocache
@rate_limit()
@@ -55,11 +55,11 @@ def stop(self, progress: float):
if progress >= self.threshold:
self.logger.debug(f'stop({self.scrobbler.media}): {progress}')
self.scrobbler.progress = progress
- self.scrobbler.stop()
+ return self.scrobbler.stop()
else:
self.logger.debug(f'pause({self.scrobbler.media}): {progress}')
self.scrobbler.progress = progress
- self.scrobbler.pause()
+ return self.scrobbler.pause()
class TraktRatingCollection(dict):

Return values for scrobble calls