Function update timeline for base.py

Function to update the timeline for a payable item. With this the item will be showed in the now playing screen.
This commit is contained in:
tijder 2018-05-12 21:29:17 +02:00 committed by GitHub
parent 725bea090f
commit 00c21c6325
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -565,6 +565,18 @@ class Playable(object):
time, state)
self._server.query(key)
self.reload()
def updateTimeline(self, time, state='stopped'):
""" Set the timeline progress for this video.
Parameters:
time (int): milliseconds watched
state (string): state of the video, default 'stopped'
"""
key = '/:/timeline?ratingKey=%s&key=%s&identifier=com.plexapp.plugins.library&time=%d&state=%s' % (self.ratingKey, self.key,
time, state)
self._server.query(key)
self.reload()
@utils.registerPlexObject