Fix Companion displaying and selecting wrong subtitle

This commit is contained in:
croneter 2018-02-23 15:24:26 +01:00
parent edff54bb7e
commit 60b90b1f52

View file

@ -190,8 +190,16 @@ class Playlist_Item(object):
""" """
stream_type = v.PLEX_STREAM_TYPE_FROM_STREAM_TYPE[stream_type] stream_type = v.PLEX_STREAM_TYPE_FROM_STREAM_TYPE[stream_type]
count = 0 count = 0
# Kodi indexes differently than Plex
for stream in self.xml[0][self.part]: for stream in self.xml[0][self.part]:
if stream.attrib['streamType'] == stream_type: if (stream.attrib['streamType'] == stream_type and
'key' in stream.attrib):
if count == kodi_stream_index:
return stream.attrib['id']
count += 1
for stream in self.xml[0][self.part]:
if (stream.attrib['streamType'] == stream_type and
'key' not in stream.attrib):
if count == kodi_stream_index: if count == kodi_stream_index:
return stream.attrib['id'] return stream.attrib['id']
count += 1 count += 1
@ -208,7 +216,14 @@ class Playlist_Item(object):
stream_type = v.PLEX_STREAM_TYPE_FROM_STREAM_TYPE[stream_type] stream_type = v.PLEX_STREAM_TYPE_FROM_STREAM_TYPE[stream_type]
count = 0 count = 0
for stream in self.xml[0][self.part]: for stream in self.xml[0][self.part]:
if stream.attrib['streamType'] == stream_type: if (stream.attrib['streamType'] == stream_type and
'key' in stream.attrib):
if stream.attrib['id'] == plex_stream_index:
return count
count += 1
for stream in self.xml[0][self.part]:
if (stream.attrib['streamType'] == stream_type and
'key' not in stream.attrib):
if stream.attrib['id'] == plex_stream_index: if stream.attrib['id'] == plex_stream_index:
return count return count
count += 1 count += 1