Fix Plex Companion telling the wrong item is playing

This commit is contained in:
croneter 2019-05-19 18:47:09 +02:00
parent ea4a062aac
commit 0ce29dc0ce

View file

@ -180,7 +180,10 @@ class PlayQueue(object):
plex_id, self.items[startpos]) plex_id, self.items[startpos])
api = API(xml[0]) api = API(xml[0])
resume = self._resume_playback(None, xml[0]) resume = self._resume_playback(None, xml[0])
self._kodi_add_xml(xml[0], api, resume) self._kodi_add_xml(xml[0],
api,
resume,
playlistitem=self.items[startpos])
# Add additional file parts, if any exist # Add additional file parts, if any exist
self._add_additional_parts(xml) self._add_additional_parts(xml)
@ -303,7 +306,8 @@ class PlayQueue(object):
LOG.debug('Adding addional part for %s: %s', api.title(), part) LOG.debug('Adding addional part for %s: %s', api.title(), part)
self._kodi_add_xml(xml[0], api) self._kodi_add_xml(xml[0], api)
def _kodi_add_xml(self, xml, api, resume=False): def _kodi_add_xml(self, xml, api, resume=False, playlistitem=None):
if not playlistitem:
playlistitem = PlaylistItem(xml_video_element=xml) playlistitem = PlaylistItem(xml_video_element=xml)
playlistitem.part = api.part playlistitem.part = api.part
playlistitem.force_transcode = self.force_transcode playlistitem.force_transcode = self.force_transcode