mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-26 02:36:10 +00:00
Quick follow up
The usual revision.
This commit is contained in:
parent
de928ec669
commit
cf17e957bb
2 changed files with 20 additions and 8 deletions
|
@ -154,6 +154,9 @@ class PlaybackUtils():
|
|||
defaultsubs = ""
|
||||
for stream in mediaStream:
|
||||
if u'Subtitle' in stream[u'Type'] and stream[u'IsDefault']:
|
||||
if u'Language' in stream:
|
||||
defaultsubs = stream[u'Language']
|
||||
else:
|
||||
defaultsubs = stream[u'Codec']
|
||||
WINDOW.setProperty("%ssubs" % playurl, defaultsubs.encode('utf-8'))
|
||||
if mediaSources[0].get('DefaultAudioStreamIndex') != None:
|
||||
|
|
|
@ -309,25 +309,34 @@ class Player( xbmc.Player ):
|
|||
self.logMsg("Door 3", 2)
|
||||
# 1. There one audio track.
|
||||
# 2. The audio is undefined or a codec.
|
||||
# 3. Audio pref could be mislabelled.
|
||||
if addon.getSetting('subsoverride') == "true":
|
||||
# 3. Audio track is be mislabeled.
|
||||
if self.subsPref in subs:
|
||||
# If the subtitle is available, only display
|
||||
# if the setting is enabled.
|
||||
if addon.getSetting('subsoverride') == "true":
|
||||
# Subs are forced.
|
||||
self.logMsg("Door 3.1", 2)
|
||||
# Only display if subs language is different than audio.
|
||||
self.logMsg("Door 3.2", 2)
|
||||
index = subs.index(self.subsPref)
|
||||
xbmcplayer.setSubtitleStream(index)
|
||||
else:
|
||||
# Let the user decide, since track is mislabeled.
|
||||
self.logMsg("Door 3.3")
|
||||
xbmcplayer.showSubtitles(False)
|
||||
else:
|
||||
# Use default subs
|
||||
if defaultsubs == "ssa":
|
||||
# For some reason, Kodi sees SSA as ''
|
||||
self.logMsg("Door 3.2", 2)
|
||||
self.logMsg("Door 3.4", 2)
|
||||
index = subs.index('')
|
||||
xbmcplayer.setSubtitleStream(index)
|
||||
elif defaultsubs:
|
||||
self.logMsg("Door 3.3", 2)
|
||||
self.logMsg("Door 3.5", 2)
|
||||
index = subs.index(defaultsubs)
|
||||
xbmcplayer.setSubtitleStream(index)
|
||||
else:
|
||||
# Nothing matches, let the user decide.
|
||||
self.logMsg("Door 3.6", 2)
|
||||
xbmcplayer.showSubtitles(False)
|
||||
|
||||
# we may need to wait until the info is available
|
||||
item_id = WINDOW.getProperty(currentFile + "item_id")
|
||||
|
|
Loading…
Reference in a new issue