2019-05-03 12:48:59 +00:00
|
|
|
sub init()
|
2020-03-03 23:01:13 +00:00
|
|
|
|
2019-05-03 12:48:59 +00:00
|
|
|
end sub
|
|
|
|
|
|
|
|
function itemContentChanged() as void
|
2020-03-05 09:11:45 +00:00
|
|
|
itemData = m.top.itemContent
|
|
|
|
if itemData = invalid then return
|
2019-05-03 12:48:59 +00:00
|
|
|
|
2020-03-05 09:11:45 +00:00
|
|
|
itemText = m.top.findNode("itemText")
|
|
|
|
itemPoster = m.top.findNode("itemPoster")
|
2020-03-03 23:01:13 +00:00
|
|
|
|
2020-03-05 09:11:45 +00:00
|
|
|
if itemData.json.CollectionType = invalid then
|
|
|
|
itemPoster.uri = itemData.imageURL
|
|
|
|
|
|
|
|
itemText.height = 34
|
|
|
|
itemText.font.size = 25
|
|
|
|
itemText.horizAlign = "left"
|
|
|
|
itemText.vertAlign = "bottom"
|
|
|
|
|
|
|
|
itemTextExtra = m.top.findNode("itemTextExtra")
|
|
|
|
itemTextExtra.font.size = 24
|
|
|
|
itemTextExtra.visible = true
|
|
|
|
|
|
|
|
if itemData.type = "Episode" then
|
|
|
|
itemText.text = itemData.json.SeriesName
|
2020-03-07 16:26:34 +00:00
|
|
|
extraPrefix = ""
|
2020-03-08 15:02:41 +00:00
|
|
|
if itemData.json.ParentIndexNumber <> invalid then
|
2020-03-07 16:26:34 +00:00
|
|
|
extraPrefix = "S" + StrI(itemData.json.ParentIndexNumber).trim()
|
|
|
|
end if
|
2020-03-08 15:02:41 +00:00
|
|
|
if itemData.json.IndexNumber <> invalid then
|
2020-03-07 16:26:34 +00:00
|
|
|
extraPrefix = extraPrefix + "E" + StrI(itemData.json.IndexNumber).trim()
|
|
|
|
end if
|
2020-03-08 15:02:41 +00:00
|
|
|
if extraPrefix.len() > 0 then
|
2020-03-07 16:26:34 +00:00
|
|
|
extraPrefix = extraPrefix + " - "
|
2020-03-08 15:02:41 +00:00
|
|
|
end if
|
2020-03-07 16:26:34 +00:00
|
|
|
itemTextExtra.text = extraPrefix + itemData.name
|
2020-03-05 09:11:45 +00:00
|
|
|
else if itemData.type = "Movie" then
|
|
|
|
itemText.text = itemData.name
|
2020-03-08 15:02:41 +00:00
|
|
|
textExtra = ""
|
|
|
|
if itemData.json.ProductionYear <> invalid then
|
|
|
|
textExtra = StrI(itemData.json.ProductionYear).trim()
|
|
|
|
end if
|
|
|
|
if itemData.json.OfficialRating <> invalid then
|
|
|
|
if textExtra <> "" then
|
|
|
|
textExtra = textExtra + " - " + itemData.json.OfficialRating
|
|
|
|
else
|
|
|
|
textExtra = itemData.json.OfficialRating
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
itemTextExtra.text = textExtra
|
2020-03-05 09:11:45 +00:00
|
|
|
end if
|
|
|
|
else
|
|
|
|
' handle libraries with no picture
|
2019-10-13 08:59:51 +00:00
|
|
|
if itemData.type = "livetv" then
|
2020-03-05 09:11:45 +00:00
|
|
|
itemPoster.width = "96"
|
|
|
|
itemPoster.height = "96"
|
|
|
|
itemPoster.translation = "[192, 88]"
|
|
|
|
itemPoster.uri = "pkg:/images/baseline_live_tv_white_48dp.png"
|
|
|
|
itemText.text = itemData.name
|
2019-10-13 20:26:20 +00:00
|
|
|
else if itemData.type = "music" then
|
2020-03-05 09:11:45 +00:00
|
|
|
itemPoster.width = "96"
|
|
|
|
itemPoster.height = "96"
|
|
|
|
itemPoster.translation = "[192, 88]"
|
|
|
|
itemPoster.uri = "pkg:/images/baseline_library_music_white_48dp.png"
|
|
|
|
itemText.text = itemData.name
|
2019-10-13 08:59:51 +00:00
|
|
|
else
|
2020-03-05 09:11:45 +00:00
|
|
|
itemPoster.uri = itemData.imageURL
|
|
|
|
itemText.text = itemData.name
|
2019-10-13 08:59:51 +00:00
|
|
|
end if
|
2020-03-05 09:11:45 +00:00
|
|
|
end if
|
2020-03-07 16:26:34 +00:00
|
|
|
end function
|