Update API docs
This commit is contained in:
parent
896efc645d
commit
480e9d9bb5
|
@ -40,10 +40,13 @@ sub init()
|
||||||
end sub
|
end sub
|
||||||
|
|
||||||
sub itemContentChanged()
|
sub itemContentChanged()
|
||||||
|
m.backdrop.blendColor = "#00a4db" ' set default in case global var is invalid
|
||||||
|
localGlobal = m.global
|
||||||
|
|
||||||
' Set Random background colors from pallet
|
if isValid(localGlobal) and isValid(localGlobal.constants) and isValid(localGlobal.constants.poster_bg_pallet)
|
||||||
posterBackgrounds = m.global.constants.poster_bg_pallet
|
posterBackgrounds = localGlobal.constants.poster_bg_pallet
|
||||||
m.backdrop.blendColor = posterBackgrounds[rnd(posterBackgrounds.count()) - 1]
|
m.backdrop.blendColor = posterBackgrounds[rnd(posterBackgrounds.count()) - 1]
|
||||||
|
end if
|
||||||
|
|
||||||
itemData = m.top.itemContent
|
itemData = m.top.itemContent
|
||||||
|
|
||||||
|
@ -58,14 +61,16 @@ sub itemContentChanged()
|
||||||
m.itemIcon.uri = itemData.iconUrl
|
m.itemIcon.uri = itemData.iconUrl
|
||||||
m.itemText.text = itemData.Title
|
m.itemText.text = itemData.Title
|
||||||
else if itemData.type = "Series"
|
else if itemData.type = "Series"
|
||||||
if m.global.session.user.settings["ui.tvshows.disableUnwatchedEpisodeCount"] = false
|
if isValid(localGlobal) and isValid(localGlobal.session) and isValid(localGlobal.session.user) and isValid(localGlobal.session.user.settings)
|
||||||
if isValid(itemData.json) and isValid(itemData.json.UserData) and isValid(itemData.json.UserData.UnplayedItemCount)
|
if localGlobal.session.user.settings["ui.tvshows.disableUnwatchedEpisodeCount"] = false
|
||||||
if itemData.json.UserData.UnplayedItemCount > 0
|
if isValid(itemData.json) and isValid(itemData.json.UserData) and isValid(itemData.json.UserData.UnplayedItemCount)
|
||||||
m.unplayedCount.visible = true
|
if itemData.json.UserData.UnplayedItemCount > 0
|
||||||
m.unplayedEpisodeCount.text = itemData.json.UserData.UnplayedItemCount
|
m.unplayedCount.visible = true
|
||||||
else
|
m.unplayedEpisodeCount.text = itemData.json.UserData.UnplayedItemCount
|
||||||
m.unplayedCount.visible = false
|
else
|
||||||
m.unplayedEpisodeCount.text = ""
|
m.unplayedCount.visible = false
|
||||||
|
m.unplayedEpisodeCount.text = ""
|
||||||
|
end if
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
|
|
|
@ -38,9 +38,10 @@ end sub
|
||||||
|
|
||||||
|
|
||||||
sub itemContentChanged()
|
sub itemContentChanged()
|
||||||
m.unplayedCount.visible = false
|
if isValid(m.unplayedCount) then m.unplayedCount.visible = false
|
||||||
itemData = m.top.itemContent
|
itemData = m.top.itemContent
|
||||||
if itemData = invalid then return
|
if itemData = invalid then return
|
||||||
|
localGlobal = m.global
|
||||||
|
|
||||||
itemData.Title = itemData.name ' Temporarily required while we move from "HomeItem" to "JFContentItem"
|
itemData.Title = itemData.name ' Temporarily required while we move from "HomeItem" to "JFContentItem"
|
||||||
|
|
||||||
|
@ -58,16 +59,17 @@ sub itemContentChanged()
|
||||||
|
|
||||||
if itemData.isWatched
|
if itemData.isWatched
|
||||||
m.playedIndicator.visible = true
|
m.playedIndicator.visible = true
|
||||||
m.unplayedCount.visible = false
|
|
||||||
else
|
else
|
||||||
m.playedIndicator.visible = false
|
m.playedIndicator.visible = false
|
||||||
|
|
||||||
if LCase(itemData.type) = "series"
|
if LCase(itemData.type) = "series"
|
||||||
if m.global.session.user.settings["ui.tvshows.disableUnwatchedEpisodeCount"] = false
|
if isValid(localGlobal) and isValid(localGlobal.session) and isValid(localGlobal.session.user) and isValid(localGlobal.session.user.settings)
|
||||||
if isValid(itemData.json.UserData) and isValid(itemData.json.UserData.UnplayedItemCount)
|
if not localGlobal.session.user.settings["ui.tvshows.disableUnwatchedEpisodeCount"]
|
||||||
if itemData.json.UserData.UnplayedItemCount > 0
|
if isValid(itemData.json.UserData) and isValid(itemData.json.UserData.UnplayedItemCount)
|
||||||
m.unplayedCount.visible = true
|
if itemData.json.UserData.UnplayedItemCount > 0
|
||||||
m.unplayedEpisodeCount.text = itemData.json.UserData.UnplayedItemCount
|
if isValid(m.unplayedCount) then m.unplayedCount.visible = true
|
||||||
|
m.unplayedEpisodeCount.text = itemData.json.UserData.UnplayedItemCount
|
||||||
|
end if
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
|
|
|
@ -77,12 +77,17 @@ sub processUserSections()
|
||||||
m.expectedRowCount = 1 ' the favorites row is hardcoded to always show atm
|
m.expectedRowCount = 1 ' the favorites row is hardcoded to always show atm
|
||||||
m.processedRowCount = 0
|
m.processedRowCount = 0
|
||||||
|
|
||||||
|
sessionUser = m.global.session.user
|
||||||
|
|
||||||
' calculate expected row count by processing homesections
|
' calculate expected row count by processing homesections
|
||||||
for i = 0 to 6
|
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"
|
if sectionName = "latestmedia"
|
||||||
' expect 1 row per filtered media library
|
' 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
|
for each latestLibrary in m.filteredLatest
|
||||||
if latestLibrary.collectionType <> "boxsets" and latestLibrary.collectionType <> "livetv" and latestLibrary.json.CollectionType <> "Program"
|
if latestLibrary.collectionType <> "boxsets" and latestLibrary.collectionType <> "livetv" and latestLibrary.json.CollectionType <> "Program"
|
||||||
m.expectedRowCount++
|
m.expectedRowCount++
|
||||||
|
@ -96,10 +101,10 @@ sub processUserSections()
|
||||||
' Add home sections in order based on user settings
|
' Add home sections in order based on user settings
|
||||||
loadedSections = 0
|
loadedSections = 0
|
||||||
for i = 0 to 6
|
for i = 0 to 6
|
||||||
sectionName = m.global.session.user.settings["homesection" + i.toStr()]
|
userSection = sessionUser.settings["homesection" + i.toStr()]
|
||||||
if not isValid(sectionName) then exit for
|
sectionName = userSection ?? "none"
|
||||||
|
|
||||||
sectionName = LCase(sectionName)
|
sectionName = LCase(sectionName)
|
||||||
|
|
||||||
sectionLoaded = false
|
sectionLoaded = false
|
||||||
if sectionName <> "none"
|
if sectionName <> "none"
|
||||||
sectionLoaded = addHomeSection(sectionName)
|
sectionLoaded = addHomeSection(sectionName)
|
||||||
|
@ -146,8 +151,13 @@ function getOriginalSectionIndex(sectionName as string) as integer
|
||||||
sectionIndex = 0
|
sectionIndex = 0
|
||||||
indexLatestMediaSection = 0
|
indexLatestMediaSection = 0
|
||||||
|
|
||||||
|
sessionUser = m.global.session.user
|
||||||
|
|
||||||
for i = 0 to 6
|
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"
|
if settingSectionName = "latestmedia"
|
||||||
indexLatestMediaSection = i
|
indexLatestMediaSection = i
|
||||||
end if
|
end if
|
||||||
|
|
|
@ -364,6 +364,7 @@ sub onVideoContentLoaded()
|
||||||
m.top.audioIndex = videoContent[0].audioIndex
|
m.top.audioIndex = videoContent[0].audioIndex
|
||||||
m.top.transcodeParams = videoContent[0].transcodeparams
|
m.top.transcodeParams = videoContent[0].transcodeparams
|
||||||
m.chapters = videoContent[0].chapters
|
m.chapters = videoContent[0].chapters
|
||||||
|
m.top.showID = videoContent[0].showID
|
||||||
|
|
||||||
m.osd.itemTitleText = m.top.content.title
|
m.osd.itemTitleText = m.top.content.title
|
||||||
|
|
||||||
|
@ -446,6 +447,11 @@ sub onNextEpisodeDataLoaded()
|
||||||
m.checkedForNextEpisode = true
|
m.checkedForNextEpisode = true
|
||||||
|
|
||||||
m.top.observeField("position", "onPositionChanged")
|
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
|
end sub
|
||||||
|
|
||||||
'
|
'
|
||||||
|
@ -560,7 +566,7 @@ sub onState(msg)
|
||||||
m.top.backPressed = true
|
m.top.backPressed = true
|
||||||
else if m.top.state = "playing"
|
else if m.top.state = "playing"
|
||||||
|
|
||||||
' Check if next episde is available
|
' Check if next episode is available
|
||||||
if isValid(m.top.showID)
|
if isValid(m.top.showID)
|
||||||
if m.top.showID <> "" and not m.checkedForNextEpisode and m.top.content.contenttype = 4
|
if m.top.showID <> "" and not m.checkedForNextEpisode and m.top.content.contenttype = 4
|
||||||
m.getNextEpisodeTask.showID = m.top.showID
|
m.getNextEpisodeTask.showID = m.top.showID
|
||||||
|
|
Loading…
Reference in New Issue
Block a user