Working for Episodes from Home Screen.
This commit is contained in:
parent
910ce95214
commit
1c33a96439
|
@ -122,6 +122,10 @@ sub Main (args as dynamic) as void
|
|||
if itemNode.type = "Episode" or itemNode.type = "Movie" or itemNode.type = "Video"
|
||||
if itemNode.type = "Episode" and itemNode.selectedAudioStreamIndex <> invalid and itemNode.selectedAudioStreamIndex > 1
|
||||
video = CreateVideoPlayerGroup(itemNode.id, invalid, itemNode.selectedAudioStreamIndex)
|
||||
else if get_user_setting("display.playback.AudioLanguagePreference") <> invalid
|
||||
langPreference = get_user_setting("display.playback.AudioLanguagePreference")
|
||||
preferredLang = FindPreferredAudioStream(itemNode.json.MediaStreams, langPreference)
|
||||
video = CreateVideoPlayerGroup(itemNode.id, invalid, preferredLang)
|
||||
else
|
||||
video = CreateVideoPlayerGroup(itemNode.id)
|
||||
end if
|
||||
|
@ -610,3 +614,15 @@ sub Main (args as dynamic) as void
|
|||
end while
|
||||
|
||||
end sub
|
||||
|
||||
function FindPreferredAudioStream(streams, preferredLanguage)
|
||||
|
||||
for i = 0 to streams.Count() - 1
|
||||
if streams[i].Type = "Audio" and streams[i].Language = preferredLanguage
|
||||
return i
|
||||
end if
|
||||
end for
|
||||
|
||||
return 0
|
||||
|
||||
end function
|
||||
|
|
|
@ -146,6 +146,15 @@ sub LoadUserPreferences()
|
|||
else
|
||||
unset_user_setting("display.livetv.landing")
|
||||
end if
|
||||
|
||||
' Get users custom configuration
|
||||
resp = APIRequest("Users/Me")
|
||||
jsonResponse = getJson(resp)
|
||||
if jsonResponse <> invalid and jsonResponse.Configuration <> invalid and jsonResponse.Configuration["AudioLanguagePreference"] <> invalid
|
||||
set_user_setting("display.playback.AudioLanguagePreference", jsonResponse.Configuration["AudioLanguagePreference"])
|
||||
else
|
||||
unset_user_setting("display.playback.AudioLanguagePreference")
|
||||
end if
|
||||
end sub
|
||||
|
||||
sub LoadUserAbilities(user)
|
||||
|
|
Loading…
Reference in New Issue
Block a user