Add updateProgress function to Video

This commit is contained in:
David Van Loon 2018-02-17 23:32:29 -06:00
parent c3dc913d81
commit f5af5d0e10
No known key found for this signature in database
GPG key ID: EBBB195D762BF472

View file

@ -77,6 +77,21 @@ class Video(PlexPartialObject):
self._server.query(key)
self.reload()
def updateProgress(self, time, state='stopped'):
""" Set the watched progress for this video.
Note that setting the time to 0 will not work.
Use `markWatched` or `markUnwatched` to achieve
that goal.
Parameters:
time (int): milliseconds watched
state (string): state of the video, default 'stopped'
"""
key = '/:/progress?key=%s&identifier=com.plexapp.plugins.library&time=%d&state=%s' % (self.ratingKey, time, state)
self._server.query(key)
self.reload()
@utils.registerPlexObject
class Movie(Video, Playable):