Skip to content

Commit 2258097

Browse files
committed
Update code docs
1 parent 9a1e553 commit 2258097

4 files changed

Lines changed: 57 additions & 45 deletions

File tree

docs/components_ItemGrid_LoadVideoContentTask.bs.html

Lines changed: 30 additions & 41 deletions
Large diffs are not rendered by default.

docs/data/search.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/module-LoadVideoContentTask.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/source_utils_misc.bs.html

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -716,11 +716,34 @@
716716

717717
' If playDefault is true, return first audio stream's Jellyfin index
718718
if isValid(playDefault) and playDefault = true
719-
return getFirstAudioStreamIndex(streams)
719+
defaultStreams = []
720+
for i = 0 to streams.Count() - 1
721+
if LCase(streams[i].Type) = "audio" and streams[i].IsDefault
722+
defaultStreams.push(streams[i])
723+
end if
724+
end for
725+
' If multiple default audio streams, try to match preferred language
726+
if defaultStreams.Count() > 1
727+
if isValid(preferredLanguage) and preferredLanguage <> ""
728+
for i = 0 to defaultStreams.Count() - 1
729+
if isValid(defaultStreams[i].Language) and LCase(defaultStreams[i].Language) = LCase(preferredLanguage)
730+
if isValid(defaultStreams[i].index)
731+
return defaultStreams[i].index
732+
end if
733+
end if
734+
end for
735+
end if
736+
end if
737+
' Fallback: return first default audio stream's Jellyfin index
738+
if defaultStreams.Count() > 0
739+
if isValid(defaultStreams[0].index)
740+
return defaultStreams[0].index
741+
end if
742+
end if
720743
end if
721744

722745
' Search for preferred language audio stream and return its Jellyfin index
723-
if isValid(preferredLanguage)
746+
if isValid(preferredLanguage) and preferredLanguage <> ""
724747
for i = 0 to streams.Count() - 1
725748
if LCase(streams[i].Type) = "audio"
726749
if isValid(streams[i].Language) and LCase(streams[i].Language) = LCase(preferredLanguage)

0 commit comments

Comments
 (0)