Skip to content

Commit

Permalink
Add progress parameter to Scrobbler methods
Browse files Browse the repository at this point in the history
This allows caller to pass progress value in same go
  • Loading branch information
glensc committed Oct 24, 2022
1 parent f6875ea commit db50999
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions trakt/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit db50999

Please sign in to comment.