mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +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,7 +154,10 @@ class PlaybackUtils():
|
||||||
defaultsubs = ""
|
defaultsubs = ""
|
||||||
for stream in mediaStream:
|
for stream in mediaStream:
|
||||||
if u'Subtitle' in stream[u'Type'] and stream[u'IsDefault']:
|
if u'Subtitle' in stream[u'Type'] and stream[u'IsDefault']:
|
||||||
defaultsubs = stream[u'Codec']
|
if u'Language' in stream:
|
||||||
|
defaultsubs = stream[u'Language']
|
||||||
|
else:
|
||||||
|
defaultsubs = stream[u'Codec']
|
||||||
WINDOW.setProperty("%ssubs" % playurl, defaultsubs.encode('utf-8'))
|
WINDOW.setProperty("%ssubs" % playurl, defaultsubs.encode('utf-8'))
|
||||||
if mediaSources[0].get('DefaultAudioStreamIndex') != None:
|
if mediaSources[0].get('DefaultAudioStreamIndex') != None:
|
||||||
WINDOW.setProperty(playurl+"AudioStreamIndex", str(mediaSources[0].get('DefaultAudioStreamIndex')))
|
WINDOW.setProperty(playurl+"AudioStreamIndex", str(mediaSources[0].get('DefaultAudioStreamIndex')))
|
||||||
|
|
|
@ -309,25 +309,34 @@ class Player( xbmc.Player ):
|
||||||
self.logMsg("Door 3", 2)
|
self.logMsg("Door 3", 2)
|
||||||
# 1. There one audio track.
|
# 1. There one audio track.
|
||||||
# 2. The audio is undefined or a codec.
|
# 2. The audio is undefined or a codec.
|
||||||
# 3. Audio pref could be mislabelled.
|
# 3. Audio track is be mislabeled.
|
||||||
if addon.getSetting('subsoverride') == "true":
|
if self.subsPref in subs:
|
||||||
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.
|
# Subs are forced.
|
||||||
self.logMsg("Door 3.1", 2)
|
self.logMsg("Door 3.2", 2)
|
||||||
# Only display if subs language is different than audio.
|
|
||||||
index = subs.index(self.subsPref)
|
index = subs.index(self.subsPref)
|
||||||
xbmcplayer.setSubtitleStream(index)
|
xbmcplayer.setSubtitleStream(index)
|
||||||
|
else:
|
||||||
|
# Let the user decide, since track is mislabeled.
|
||||||
|
self.logMsg("Door 3.3")
|
||||||
|
xbmcplayer.showSubtitles(False)
|
||||||
else:
|
else:
|
||||||
# Use default subs
|
# Use default subs
|
||||||
if defaultsubs == "ssa":
|
if defaultsubs == "ssa":
|
||||||
# For some reason, Kodi sees SSA as ''
|
# For some reason, Kodi sees SSA as ''
|
||||||
self.logMsg("Door 3.2", 2)
|
self.logMsg("Door 3.4", 2)
|
||||||
index = subs.index('')
|
index = subs.index('')
|
||||||
xbmcplayer.setSubtitleStream(index)
|
xbmcplayer.setSubtitleStream(index)
|
||||||
elif defaultsubs:
|
elif defaultsubs:
|
||||||
self.logMsg("Door 3.3", 2)
|
self.logMsg("Door 3.5", 2)
|
||||||
index = subs.index(defaultsubs)
|
index = subs.index(defaultsubs)
|
||||||
xbmcplayer.setSubtitleStream(index)
|
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
|
# we may need to wait until the info is available
|
||||||
item_id = WINDOW.getProperty(currentFile + "item_id")
|
item_id = WINDOW.getProperty(currentFile + "item_id")
|
||||||
|
|
Loading…
Reference in a new issue