mirror of
https://github.com/jellyfin/jellyfin-roku.git
synced 2024-11-27 00:10:43 +00:00
Merge pull request #1949 from cewert/fix-home-item-crash
This commit is contained in:
commit
ed6234937f
@ -10,12 +10,12 @@ sub init()
|
||||
initItemPoster()
|
||||
m.itemProgress = m.top.findNode("progress")
|
||||
m.itemProgressBackground = m.top.findNode("progressBackground")
|
||||
m.itemIcon = m.top.findNode("itemIcon")
|
||||
initItemIcon()
|
||||
initItemTextExtra()
|
||||
m.itemPoster.observeField("loadStatus", "onPosterLoadStatusChanged")
|
||||
m.unplayedCount = m.top.findNode("unplayedCount")
|
||||
m.unplayedEpisodeCount = m.top.findNode("unplayedEpisodeCount")
|
||||
m.playedIndicator = m.top.findNode("playedIndicator")
|
||||
initPlayedIndicator()
|
||||
|
||||
m.showProgressBarAnimation = m.top.findNode("showProgressBar")
|
||||
m.showProgressBarField = m.top.findNode("showProgressBarField")
|
||||
@ -50,6 +50,14 @@ sub initBackdrop()
|
||||
m.backdrop = m.top.findNode("backdrop")
|
||||
end sub
|
||||
|
||||
sub initItemIcon()
|
||||
m.itemIcon = m.top.findNode("itemIcon")
|
||||
end sub
|
||||
|
||||
sub initPlayedIndicator()
|
||||
m.playedIndicator = m.top.findNode("playedIndicator")
|
||||
end sub
|
||||
|
||||
sub itemContentChanged()
|
||||
if isValid(m.unplayedCount) then m.unplayedCount.visible = false
|
||||
itemData = m.top.itemContent
|
||||
@ -63,6 +71,8 @@ sub itemContentChanged()
|
||||
if not isValid(m.itemText) then initItemText()
|
||||
if not isValid(m.itemTextExtra) then initItemTextExtra()
|
||||
if not isValid(m.backdrop) then initBackdrop()
|
||||
if not isValid(m.itemIcon) then initItemIcon()
|
||||
if not isValid(m.playedIndicator) then initPlayedIndicator()
|
||||
|
||||
m.itemPoster.width = itemData.imageWidth
|
||||
m.itemText.maxWidth = itemData.imageWidth
|
||||
@ -87,6 +97,7 @@ sub itemContentChanged()
|
||||
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
|
||||
if isValid(m.unplayedEpisodeCount)
|
||||
m.unplayedEpisodeCount.text = itemData.json.UserData.UnplayedItemCount
|
||||
end if
|
||||
end if
|
||||
@ -94,6 +105,7 @@ sub itemContentChanged()
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
|
||||
' Format the Data based on the type of Home Data
|
||||
if itemData.type = "CollectionFolder" or itemData.type = "UserView" or itemData.type = "Channel"
|
||||
|
Loading…
Reference in New Issue
Block a user