2020-03-12 18:33:45 +00:00
|
|
|
sub itemContentChanged()
|
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-12 18:33:45 +00:00
|
|
|
itemTextExtra = m.top.findNode("itemTextExtra")
|
2020-03-03 23:01:13 +00:00
|
|
|
|
2020-03-12 18:33:45 +00:00
|
|
|
' Desired Image Width
|
|
|
|
imageWidth = 464
|
|
|
|
if m.top.GetParent().content.imageWidth <> invalid
|
|
|
|
imageWidth = m.top.GetParent().content.imageWidth
|
|
|
|
end if
|
2020-03-05 09:11:45 +00:00
|
|
|
|
2020-03-12 18:33:45 +00:00
|
|
|
itemPoster.width = imageWidth
|
|
|
|
itemText.width = imageWidth
|
|
|
|
itemTextExtra.width = imageWidth
|
2020-03-05 09:11:45 +00:00
|
|
|
|
2020-03-12 18:33:45 +00:00
|
|
|
' Whether to use WidePoster or Thumbnail in this row
|
|
|
|
usePoster = m.top.GetParent().content.usePoster
|
2020-03-05 09:11:45 +00:00
|
|
|
|
2020-03-12 18:33:45 +00:00
|
|
|
|
|
|
|
' Format the Data based on the type of Home Data
|
|
|
|
|
|
|
|
if itemData.type = "CollectionFolder" then
|
|
|
|
itemText.text = itemData.name
|
|
|
|
itemPoster.uri = itemData.widePosterURL
|
|
|
|
return
|
|
|
|
end if
|
|
|
|
|
2020-03-15 17:09:51 +00:00
|
|
|
if itemData.type = "UserView" then
|
|
|
|
itemPoster.width = "96"
|
|
|
|
itemPoster.height = "96"
|
|
|
|
itemPoster.translation = "[192, 88]"
|
|
|
|
itemText.text = itemData.name
|
|
|
|
itemPoster.uri = itemData.widePosterURL
|
|
|
|
return
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
2020-03-12 18:33:45 +00:00
|
|
|
itemText.height = 34
|
|
|
|
itemText.font.size = 25
|
|
|
|
itemText.horizAlign = "left"
|
|
|
|
itemText.vertAlign = "bottom"
|
|
|
|
itemTextExtra.visible = true
|
|
|
|
itemTextExtra.font.size = 22
|
|
|
|
|
|
|
|
|
|
|
|
if itemData.type = "Episode" then
|
2020-03-16 16:37:08 +00:00
|
|
|
itemText.text = itemData.json.SeriesName
|
2020-03-12 18:33:45 +00:00
|
|
|
|
|
|
|
if usePoster = true then
|
|
|
|
itemPoster.uri = itemData.widePosterURL
|
|
|
|
else
|
|
|
|
itemPoster.uri = itemData.thumbnailURL
|
|
|
|
end if
|
|
|
|
|
|
|
|
' Set Series and Episode Number for Extra Text
|
|
|
|
extraPrefix = ""
|
|
|
|
if itemData.json.ParentIndexNumber <> invalid then
|
|
|
|
extraPrefix = "S" + StrI(itemData.json.ParentIndexNumber).trim()
|
|
|
|
end if
|
|
|
|
if itemData.json.IndexNumber <> invalid then
|
|
|
|
extraPrefix = extraPrefix + "E" + StrI(itemData.json.IndexNumber).trim()
|
|
|
|
end if
|
|
|
|
if extraPrefix.len() > 0 then
|
|
|
|
extraPrefix = extraPrefix + " - "
|
|
|
|
end if
|
|
|
|
|
|
|
|
itemTextExtra.text = extraPrefix + itemData.name
|
|
|
|
return
|
|
|
|
end if
|
|
|
|
|
|
|
|
if itemData.type = "Movie" then
|
|
|
|
itemText.text = itemData.name
|
|
|
|
|
|
|
|
if imageWidth = 180
|
|
|
|
itemPoster.uri = itemData.posterURL
|
|
|
|
else
|
|
|
|
itemPoster.uri = itemData.thumbnailURL
|
|
|
|
end if
|
|
|
|
|
|
|
|
' Set Release Year and Age Rating for Extra Text
|
|
|
|
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
|
2020-03-08 15:02:41 +00:00
|
|
|
end if
|
2020-03-05 09:11:45 +00:00
|
|
|
end if
|
2020-03-12 18:33:45 +00:00
|
|
|
itemTextExtra.text = textExtra
|
|
|
|
|
|
|
|
return
|
|
|
|
end if
|
|
|
|
|
|
|
|
if itemData.type = "Series" then
|
|
|
|
|
|
|
|
itemText.text = itemData.name
|
|
|
|
|
|
|
|
if usePoster = true then
|
|
|
|
itemPoster.uri = itemData.widePosterURL
|
2019-10-13 08:59:51 +00:00
|
|
|
else
|
2020-03-12 18:33:45 +00:00
|
|
|
itemPoster.uri = itemData.thumbnailURL
|
|
|
|
end if
|
|
|
|
|
|
|
|
textExtra = ""
|
|
|
|
if itemData.json.ProductionYear <> invalid then
|
|
|
|
textExtra = StrI(itemData.json.ProductionYear).trim()
|
2019-10-13 08:59:51 +00:00
|
|
|
end if
|
2020-03-12 18:33:45 +00:00
|
|
|
|
|
|
|
' Set Years Run for Extra Text
|
|
|
|
if itemData.json.Status = "Continuing" then
|
|
|
|
textExtra = textExtra + " - Present"
|
|
|
|
else if itemData.json.Status = "Ended" and itemData.json.EndDate <> invalid
|
|
|
|
textExtra = textExtra + " - " + LEFT(itemData.json.EndDate, 4)
|
|
|
|
end if
|
|
|
|
itemTextExtra.text = textExtra
|
|
|
|
|
|
|
|
return
|
2020-03-05 09:11:45 +00:00
|
|
|
end if
|
2020-03-12 18:33:45 +00:00
|
|
|
|
|
|
|
if itemData.type = "MusicAlbum" then
|
|
|
|
itemText.text = itemData.name
|
|
|
|
itemTextExtra.text = itemData.json.AlbumArtist
|
|
|
|
itemPoster.uri = itemData.posterURL
|
|
|
|
return
|
|
|
|
end if
|
|
|
|
|
|
|
|
print "Unhandled Item Type: " + itemData.type
|
|
|
|
|
|
|
|
end sub
|