Fix Plex Companion offset not working

This commit is contained in:
tomkat83 2016-12-28 14:57:10 +01:00
parent e24f6b53fc
commit 5b020910d3
2 changed files with 6 additions and 4 deletions

View file

@ -87,7 +87,7 @@ class PlexCompanion(Thread):
data['type'])
if ID != playqueue.ID:
self.mgr.playqueue.update_playqueue_from_PMS(
playqueue, ID, int(query['repeat']))
playqueue, ID, int(query['repeat']), data['offset'])
else:
log.error('This has never happened before!')

View file

@ -83,21 +83,23 @@ class Playqueue(Thread):
def update_playqueue_from_PMS(self,
playqueue,
playqueue_id=None,
repeat=None):
repeat=None,
offset=None):
"""
Completely updates the Kodi playqueue with the new Plex playqueue. Pass
in playqueue_id if we need to fetch a new playqueue
repeat = 0, 1, 2
offset = time offset in Plextime
"""
log.info('New playqueue received from the PMS, updating!')
PL.update_playlist_from_PMS(playqueue, playqueue_id, repeat)
log.debug('Updated playqueue: %s' % playqueue)
window('plex_customplaylist', value="true")
if playqueue.selectedItemOffset not in (None, "0"):
if offset not in (None, "0"):
window('plex_customplaylist.seektime',
str(ConvertPlexToKodiTime(playqueue.selectedItemOffset)))
str(ConvertPlexToKodiTime(offset)))
for startpos, item in enumerate(playqueue.items):
if item.ID == playqueue.selectedItemID:
break