Update API docs

This commit is contained in:
jellyfin-bot 2024-02-06 14:11:09 +00:00
parent 31f91c7500
commit 244823f470
2 changed files with 21 additions and 2 deletions

View File

@ -251,7 +251,14 @@ function defaultSubtitleTrackFromVid(videoID) as integer
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

View File

@ -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)