From 350a5302ed4b1b69d179ed749500f8d46a3b316e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Mon, 31 Jan 2022 00:13:05 +0200 Subject: [PATCH] Return responses of Scrobble methods --- trakt/sync.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/trakt/sync.py b/trakt/sync.py index c4bf7cf..12fd75a 100644 --- a/trakt/sync.py +++ b/trakt/sync.py @@ -456,15 +456,15 @@ def __init__(self, media, progress, app_version, app_date): def start(self): """Start scrobbling this :class:`Scrobbler`'s *media* object""" - self._post('scrobble/start') + return self._post('scrobble/start') def pause(self): """Pause the scrobbling of this :class:`Scrobbler`'s *media* object""" - self._post('scrobble/pause') + return self._post('scrobble/pause') def stop(self): """Stop the scrobbling of this :class:`Scrobbler`'s *media* object""" - self._post('scrobble/stop') + return self._post('scrobble/stop') def finish(self): """Complete the scrobbling this :class:`Scrobbler`'s *media* object""" @@ -477,7 +477,7 @@ def update(self, progress): object """ self.progress = progress - self.start() + return self.start() @post def _post(self, uri): @@ -488,7 +488,8 @@ def _post(self, uri): payload = dict(progress=self.progress, app_version=self.version, date=self.date) payload.update(self.media.to_json_singular()) - yield uri, payload + response = yield uri, payload + yield response def __enter__(self): """Context manager support for `with Scrobbler` syntax. Begins