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 Sep 29, 2024
1 parent 4f1f333 commit 3a7882e
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 21 deletions.
6 changes: 3 additions & 3 deletions docs/api/components_ItemGrid_GridItem.bs.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
m.checkmark.width = 90
m.checkmark.height = 60

m.itemText.translation = [0, m.itemPoster.height + 7]
m.itemText.visible = m.gridTitles = "showalways"

' Add some padding space when Item Titles are always showing
if m.itemText.visible then m.itemText.maxWidth = 250

Expand All @@ -40,6 +37,9 @@
end if
end if

m.itemText.translation = [0, m.itemPoster.height + 7]
m.itemText.visible = m.gridTitles = "showalways"

end sub

sub itemContentChanged()
Expand Down
42 changes: 37 additions & 5 deletions docs/api/components_ItemGrid_ItemGrid.bs.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

sub init()
m.log = log.Logger("ItemGrid")
m.log.debug("start init()")
m.options = m.top.findNode("options")

m.showItemCount = m.global.session.user.settings["itemgrid.showItemCount"]
Expand Down Expand Up @@ -72,6 +73,7 @@
m.resetGrid = m.global.session.user.settings["itemgrid.reset"]

m.top.gridTitles = m.global.session.user.settings["itemgrid.gridTitles"]
m.log.debug("end init()")
end sub

'Genre Item Selected
Expand All @@ -81,6 +83,7 @@

'Load initial set of Data
sub loadInitialItems()
m.log.debug("start loadInitialItems()")
m.loadItemsTask.control = "stop"
startLoadingSpinner()

Expand Down Expand Up @@ -237,6 +240,7 @@
startLoadingSpinner(false)
m.loadItemsTask.control = "RUN"
SetUpOptions()
m.log.debug("end loadInitialItems()")
end sub

' Set Movies view, sort, and filter options
Expand Down Expand Up @@ -447,6 +451,7 @@

'Handle loaded data, and add to Grid
sub ItemDataLoaded(msg)
m.log.debug("start ItemDataLoaded()")
itemData = msg.GetData()
m.loadItemsTask.unobserveField("content")
m.loadItemsTask.content = []
Expand Down Expand Up @@ -503,22 +508,28 @@
end if

stopLoadingSpinner()
m.log.debug("end ItemDataLoaded()")
end sub

'Set Background Image
sub SetBackground(backgroundUri as string)

m.log.debug("start SetBackground()", backgroundUri, m.swapAnimation.state, m.newBackdrop.loadStatus)
'If a new image is being loaded, or transitioned to, store URL to load next
if m.swapAnimation.state <> "stopped" or m.newBackdrop.loadStatus = "loading"
m.queuedBGUri = backgroundUri
return
if not m.top.alphaActive
if m.swapAnimation.state <> "stopped" or m.newBackdrop.loadStatus = "loading"
m.log.debug("caching new background URI")
m.queuedBGUri = backgroundUri
return
end if
end if

m.newBackdrop.uri = backgroundUri
m.log.debug("end SetBackground()")
end sub

'Handle new item being focused
sub onItemFocused()
m.log.debug("start onItemFocused()", m.itemGrid.currFocusRow, m.itemGrid.itemFocused)

focusedRow = m.itemGrid.currFocusRow

Expand All @@ -527,7 +538,7 @@
updateTitle()

' If no selected item, set background to parent backdrop
if itemInt = -1
if itemInt = -1 or focusedRow = -1
return
end if

Expand All @@ -540,6 +551,7 @@
if focusedRow >= m.loadedRows - 5 and m.loadeditems < m.loadItemsTask.totalRecordCount
loadMoreData()
end if
m.log.debug("end onItemFocused()")
end sub

'When Image Loading Status changes
Expand All @@ -560,6 +572,7 @@

'If there is another one to load
if m.newBackdrop.uri <> m.queuedBGUri and m.queuedBGUri <> ""
m.log.debug("Loading queued backdrop image", m.queuedBGUri)
SetBackground(m.queuedBGUri)
m.queuedBGUri = ""
end if
Expand All @@ -568,13 +581,15 @@

'Load next set of items
sub loadMoreData()
m.log.debug("start loadMoreData()")
if m.Loading = true then return

startLoadingSpinner(false)
m.Loading = true
m.loadItemsTask.startIndex = m.loadedItems
m.loadItemsTask.observeField("content", "ItemDataLoaded")
m.loadItemsTask.control = "RUN"
m.log.debug("end loadMoreData()")
end sub

'Item Selected
Expand Down Expand Up @@ -769,6 +784,20 @@
return invalid
end function

sub alphaActiveChanged()
m.log.debug("start alphaActiveChanged()", m.top.alphaActive)

if m.top.alphaActive
' fade into an empty backdrop
m.swapAnimation.state = "stop"
m.queuedBGUri = ""
' use a 1px image because we can't use the animation to fade into a blank uri string
SetBackground("pkg:/images/1px-262626.png")
end if

m.log.debug("end alphaActiveChanged()")
end sub

function onKeyEvent(key as string, press as boolean) as boolean
if not press then return false

Expand Down Expand Up @@ -835,11 +864,14 @@
return true
end if
else if key = "left" and topGrp.isinFocusChain() and m.alpha.visible
m.log.debug("Now entering alpha menu")
m.top.alphaActive = true
topGrp.setFocus(false)
m.alphaMenu.setFocus(true)

return true
else if key = "right" and m.alpha.isinFocusChain()
m.log.debug("Now leaving alpha menu")
m.top.alphaActive = false
m.alphaMenu.setFocus(false)
topGrp.setFocus(true)
Expand Down
2 changes: 1 addition & 1 deletion docs/api/components_PlaystateTask.bs.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
sub PlaystateUpdate()
if m.top.status = "start"
url = "Sessions/Playing"
else if m.top.status = "stop"
else if m.top.status = "stop" or m.top.status = "finished"
url = "Sessions/Playing/Stopped"
else if m.top.status = "update"
url = "Sessions/Playing/Progress"
Expand Down
36 changes: 28 additions & 8 deletions docs/api/components_video_VideoPlayerView.bs.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/api/data/search.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/api/module-ItemGrid.html

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion docs/api/source_api_Items.bs.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,17 @@
"SubtitleStreamIndex": subtitleTrackIndex
}

if mediaSourceId <> "" then params.MediaSourceId = mediaSourceId
' Note: Jellyfin v10.9+ now remuxs LiveTV and does not allow DirectPlay anymore.
' Because of this, we need to tell the server "EnableDirectPlay = false" so that we receive the
' transcoding URL (which is just a remux and not a transcode; unless it is)
' The web handles this by disabling EnableDirectPlay on a Retry, but we don't currently Retry a Live
' TV stream, thus we just turn it off on the first try here.
if mediaSourceId <> ""
params.MediaSourceId = mediaSourceId
else
' No mediaSourceId? Must be LiveTV...
params.EnableDirectPlay = false
end if

if audioTrackIndex > -1 then params.AudioStreamIndex = audioTrackIndex

Expand Down
21 changes: 20 additions & 1 deletion docs/api/source_utils_deviceCapabilities.bs.html
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,26 @@
if di.CanDecodeAudio({ Codec: audioCodec, ChCnt: audioChannel }).Result
channelSupportFound = true
for each codecType in ["VideoAudio", "Audio"]
if audioCodec = "opus" and codecType = "Audio"
if audioCodec = "aac"
codecProfiles.push({
"Type": codecType,
"Codec": audioCodec,
"Conditions": [
{
"Condition": "NotEquals",
"Property": "AudioProfile",
"Value": "Main",
"IsRequired": true
},
{
"Condition": "LessThanEqual",
"Property": "AudioChannels",
"Value": audioChannel,
"IsRequired": true
}
]
})
else if audioCodec = "opus" and codecType = "Audio"
' opus audio files not supported by roku
else
codecProfiles.push({
Expand Down

0 comments on commit 3a7882e

Please sign in to comment.