From db50999b52244df8e3a615e294baa97a3217cc32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Mon, 24 Oct 2022 23:23:17 +0300 Subject: [PATCH] Add progress parameter to Scrobbler methods This allows caller to pass progress value in same go --- trakt/sync.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/trakt/sync.py b/trakt/sync.py index 32c7bc78..5610eb75 100644 --- a/trakt/sync.py +++ b/trakt/sync.py @@ -457,16 +457,22 @@ def __init__(self, media, progress, app_version, app_date): if self.progress > 0: self.start() - def start(self): + def start(self, progress=None): """Start scrobbling this :class:`Scrobbler`'s *media* object""" + if progress is not None: + self.progress = progress return self._post('scrobble/start') - def pause(self): + def pause(self, progress=None): """Pause the scrobbling of this :class:`Scrobbler`'s *media* object""" + if progress is not None: + self.progress = progress return self._post('scrobble/pause') - def stop(self): + def stop(self, progress=None): """Stop the scrobbling of this :class:`Scrobbler`'s *media* object""" + if progress is not None: + self.progress = progress return self._post('scrobble/stop') def finish(self):