Fix multiple subtitles per language not showing

- Fixes #292
This commit is contained in:
tomkat83 2017-05-08 19:15:50 +02:00
parent 353e1bee01
commit 21d13c6471

View file

@ -2303,6 +2303,7 @@ class API():
except (TypeError, KeyError, IndexError): except (TypeError, KeyError, IndexError):
return return
kodiindex = 0 kodiindex = 0
fileindex = 0
for stream in mediastreams: for stream in mediastreams:
# Since plex returns all possible tracks together, have to pull # Since plex returns all possible tracks together, have to pull
# only external subtitles - only for these a 'key' exists # only external subtitles - only for these a 'key' exists
@ -2318,8 +2319,10 @@ class API():
if stream.attrib.get('languageCode') is not None: if stream.attrib.get('languageCode') is not None:
path = self.download_external_subtitles( path = self.download_external_subtitles(
"{server}%s" % key, "{server}%s" % key,
"subtitle.%s.%s" % (stream.attrib['languageCode'], "subtitle%02d.%s.%s" % (fileindex,
stream.attrib['languageCode'],
stream.attrib['codec'])) stream.attrib['codec']))
fileindex += 1
# We don't know the language - no need to download # We don't know the language - no need to download
else: else:
path = self.addPlexCredentialsToUrl( path = self.addPlexCredentialsToUrl(