Skip to content

Commit

Permalink
Update API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jellyfin-bot committed Feb 6, 2024
1 parent 31f91c7 commit 244823f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
9 changes: 8 additions & 1 deletion docs/api/components_ItemGrid_LoadVideoContentTask.bs.html
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,14 @@
if not isValidAndNotEmpty(meta.json.MediaSources[0].MediaStreams) then return SubtitleSelection.none

subtitles = sortSubtitles(meta.id, meta.json.MediaSources[0].MediaStreams)
selectedAudioLanguage = meta.json.MediaSources[0].MediaStreams[m.top.selectedAudioStreamIndex].Language ?? ""

selectedAudioLanguage = ""
audioMediaStream = meta.json.MediaSources[0].MediaStreams[m.top.selectedAudioStreamIndex]

' Ensure audio media stream is valid before using language property
if isValid(audioMediaStream)
selectedAudioLanguage = audioMediaStream.Language ?? ""
end if

defaultTextSubs = defaultSubtitleTrack(subtitles["text"], selectedAudioLanguage, true) ' Find correct subtitle track (forced text)
if defaultTextSubs <> SubtitleSelection.none
Expand Down
14 changes: 13 additions & 1 deletion docs/api/source_Main.bs.html
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,19 @@
end if

' Display playback options dialog
if selectedItem.json.userdata.PlaybackPositionTicks > 0
showPlaybackOptionDialog = false

if isValid(selectedItem.json)
if isValid(selectedItem.json.userdata)
if isValid(selectedItem.json.userdata.PlaybackPositionTicks)
if selectedItem.json.userdata.PlaybackPositionTicks > 0
showPlaybackOptionDialog = true
end if
end if
end if
end if

if showPlaybackOptionDialog
dialog.close = true
m.global.queueManager.callFunc("hold", selectedItem)
playbackOptionDialog(selectedItem.json.userdata.PlaybackPositionTicks, selectedItem.json)
Expand Down

0 comments on commit 244823f

Please sign in to comment.