Update API docs

This commit is contained in:
jellyfin-bot 2024-02-20 13:55:51 +00:00
parent 896efc645d
commit 480e9d9bb5
4 changed files with 48 additions and 25 deletions

View File

@ -40,10 +40,13 @@ sub init()
end sub
sub itemContentChanged()
m.backdrop.blendColor = "#00a4db" ' set default in case global var is invalid
localGlobal = m.global
' Set Random background colors from pallet
posterBackgrounds = m.global.constants.poster_bg_pallet
m.backdrop.blendColor = posterBackgrounds[rnd(posterBackgrounds.count()) - 1]
if isValid(localGlobal) and isValid(localGlobal.constants) and isValid(localGlobal.constants.poster_bg_pallet)
posterBackgrounds = localGlobal.constants.poster_bg_pallet
m.backdrop.blendColor = posterBackgrounds[rnd(posterBackgrounds.count()) - 1]
end if
itemData = m.top.itemContent
@ -58,14 +61,16 @@ sub itemContentChanged()
m.itemIcon.uri = itemData.iconUrl
m.itemText.text = itemData.Title
else if itemData.type = "Series"
if m.global.session.user.settings["ui.tvshows.disableUnwatchedEpisodeCount"] = false
if isValid(itemData.json) and isValid(itemData.json.UserData) and isValid(itemData.json.UserData.UnplayedItemCount)
if itemData.json.UserData.UnplayedItemCount > 0
m.unplayedCount.visible = true
m.unplayedEpisodeCount.text = itemData.json.UserData.UnplayedItemCount
else
m.unplayedCount.visible = false
m.unplayedEpisodeCount.text = ""
if isValid(localGlobal) and isValid(localGlobal.session) and isValid(localGlobal.session.user) and isValid(localGlobal.session.user.settings)
if localGlobal.session.user.settings["ui.tvshows.disableUnwatchedEpisodeCount"] = false
if isValid(itemData.json) and isValid(itemData.json.UserData) and isValid(itemData.json.UserData.UnplayedItemCount)
if itemData.json.UserData.UnplayedItemCount > 0
m.unplayedCount.visible = true
m.unplayedEpisodeCount.text = itemData.json.UserData.UnplayedItemCount
else
m.unplayedCount.visible = false
m.unplayedEpisodeCount.text = ""
end if
end if
end if
end if

View File

@ -38,9 +38,10 @@ end sub
sub itemContentChanged()
m.unplayedCount.visible = false
if isValid(m.unplayedCount) then m.unplayedCount.visible = false
itemData = m.top.itemContent
if itemData = invalid then return
localGlobal = m.global
itemData.Title = itemData.name ' Temporarily required while we move from "HomeItem" to "JFContentItem"
@ -58,16 +59,17 @@ sub itemContentChanged()
if itemData.isWatched
m.playedIndicator.visible = true
m.unplayedCount.visible = false
else
m.playedIndicator.visible = false
if LCase(itemData.type) = "series"
if m.global.session.user.settings["ui.tvshows.disableUnwatchedEpisodeCount"] = false
if isValid(itemData.json.UserData) and isValid(itemData.json.UserData.UnplayedItemCount)
if itemData.json.UserData.UnplayedItemCount > 0
m.unplayedCount.visible = true
m.unplayedEpisodeCount.text = itemData.json.UserData.UnplayedItemCount
if isValid(localGlobal) and isValid(localGlobal.session) and isValid(localGlobal.session.user) and isValid(localGlobal.session.user.settings)
if not localGlobal.session.user.settings["ui.tvshows.disableUnwatchedEpisodeCount"]
if isValid(itemData.json.UserData) and isValid(itemData.json.UserData.UnplayedItemCount)
if itemData.json.UserData.UnplayedItemCount > 0
if isValid(m.unplayedCount) then m.unplayedCount.visible = true
m.unplayedEpisodeCount.text = itemData.json.UserData.UnplayedItemCount
end if
end if
end if
end if

View File

@ -77,12 +77,17 @@ sub processUserSections()
m.expectedRowCount = 1 ' the favorites row is hardcoded to always show atm
m.processedRowCount = 0
sessionUser = m.global.session.user
' calculate expected row count by processing homesections
for i = 0 to 6
sectionName = LCase(m.global.session.user.settings["homesection" + i.toStr()])
userSection = sessionUser.settings["homesection" + i.toStr()]
sectionName = userSection ?? "none"
sectionName = LCase(sectionName)
if sectionName = "latestmedia"
' expect 1 row per filtered media library
m.filteredLatest = filterNodeArray(m.libraryData, "id", m.global.session.user.configuration.LatestItemsExcludes)
m.filteredLatest = filterNodeArray(m.libraryData, "id", sessionUser.configuration.LatestItemsExcludes)
for each latestLibrary in m.filteredLatest
if latestLibrary.collectionType <> "boxsets" and latestLibrary.collectionType <> "livetv" and latestLibrary.json.CollectionType <> "Program"
m.expectedRowCount++
@ -96,10 +101,10 @@ sub processUserSections()
' Add home sections in order based on user settings
loadedSections = 0
for i = 0 to 6
sectionName = m.global.session.user.settings["homesection" + i.toStr()]
if not isValid(sectionName) then exit for
userSection = sessionUser.settings["homesection" + i.toStr()]
sectionName = userSection ?? "none"
sectionName = LCase(sectionName)
sectionLoaded = false
if sectionName <> "none"
sectionLoaded = addHomeSection(sectionName)
@ -146,8 +151,13 @@ function getOriginalSectionIndex(sectionName as string) as integer
sectionIndex = 0
indexLatestMediaSection = 0
sessionUser = m.global.session.user
for i = 0 to 6
settingSectionName = LCase(m.global.session.user.settings["homesection" + i.toStr()])
userSection = sessionUser.settings["homesection" + i.toStr()]
settingSectionName = userSection ?? "none"
settingSectionName = LCase(settingSectionName)
if settingSectionName = "latestmedia"
indexLatestMediaSection = i
end if

View File

@ -364,6 +364,7 @@ sub onVideoContentLoaded()
m.top.audioIndex = videoContent[0].audioIndex
m.top.transcodeParams = videoContent[0].transcodeparams
m.chapters = videoContent[0].chapters
m.top.showID = videoContent[0].showID
m.osd.itemTitleText = m.top.content.title
@ -446,6 +447,11 @@ sub onNextEpisodeDataLoaded()
m.checkedForNextEpisode = true
m.top.observeField("position", "onPositionChanged")
' If there is no next episode, disable next episode button
if m.getNextEpisodeTask.nextEpisodeData.Items.count() <> 2
m.nextupbuttonseconds = 0
end if
end sub
'
@ -560,7 +566,7 @@ sub onState(msg)
m.top.backPressed = true
else if m.top.state = "playing"
' Check if next episde is available
' Check if next episode is available
if isValid(m.top.showID)
if m.top.showID <> "" and not m.checkedForNextEpisode and m.top.content.contenttype = 4
m.getNextEpisodeTask.showID = m.top.showID