Add IconUrl to Home Screen Items and set for LiveTV when no poster

This commit is contained in:
Neil Burrows 2020-10-25 16:32:26 +00:00
parent 3be4a0bbda
commit 3d9bbc584a
4 changed files with 11 additions and 0 deletions

View File

@ -20,6 +20,11 @@ sub setData()
m.top.thumbnailURL = ImageURL(datum.id, "Primary", params)
m.top.widePosterUrl = m.top.thumbnailURL
' Add Icon URLs for display if there is no Poster
if datum.CollectionType = "livetv" then
m.top.iconUrl = "pkg:/images/baseline_live_tv_white_48dp.png"
end if
else if datum.type = "Episode" then
imgParams = { "AddPlayedIndicator": datum.UserData.Played }

View File

@ -4,6 +4,7 @@
<field id="id" type="string" />
<field id="name" type="string" />
<field id="thumbnailURL" type="string" />
<field id="iconURL" type="string" />
<field id="posterURL" type="string" />
<field id="widePosterURL" type="string" />
<field id="type" type="string" />

View File

@ -5,6 +5,7 @@ sub itemContentChanged()
m.itemText = m.top.findNode("itemText")
itemPoster = m.top.findNode("itemPoster")
itemIcon = m.top.findNode("itemIcon")
itemTextExtra = m.top.findNode("itemTextExtra")
' Desired Image Width
@ -26,6 +27,9 @@ sub itemContentChanged()
' Whether to use WidePoster or Thumbnail in this row
usePoster = m.top.GetParent().content.usePoster
if itemData.iconUrl <> invalid
itemIcon.uri = itemData.iconUrl
end if
' Format the Data based on the type of Home Data

View File

@ -2,6 +2,7 @@
<component name="HomeItem" extends="Group">
<children>
<Rectangle id="backdrop" width="464" height="261" translation="[8,5]" />
<Poster id="itemIcon" width="100" height="100" translation="[190,85]" loadDisplayMode="scaleToFit" />
<Poster id="itemPoster" width="464" height="261" translation="[8,5]" loadDisplayMode="scaleToZoom" />
<ScrollingLabel id="itemText" horizAlign="center" vertAlign="center" font="font:SmallBoldSystemFont" height="64" maxWidth="456" translation="[8,267]" repeatCount="0" />
<Label id="itemTextExtra" horizAlign="left" vertAlign="center" font="font:SmallBoldSystemFont" height="32" width="456" translation="[8,300]" visible="false" color="#777777FF" />