diff --git a/resources/lib/PlexCompanion.py b/resources/lib/PlexCompanion.py index 002a6f91..bdbb37b4 100644 --- a/resources/lib/PlexCompanion.py +++ b/resources/lib/PlexCompanion.py @@ -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!') diff --git a/resources/lib/playqueue.py b/resources/lib/playqueue.py index e4f0f4f5..c969b5d5 100644 --- a/resources/lib/playqueue.py +++ b/resources/lib/playqueue.py @@ -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