jf-roku/components/data/CollectionData.brs

37 lines
1.0 KiB
Plaintext
Raw Normal View History

2019-05-03 12:48:59 +00:00
sub setFields()
2021-07-09 20:08:32 +00:00
json = m.top.json
2019-05-03 12:48:59 +00:00
2021-07-09 20:08:32 +00:00
m.top.id = json.id
m.top.Title = json.name
m.top.overview = json.overview
m.top.Description = json.overview
m.top.favorite = json.UserData.isFavorite
m.top.watched = json.UserData.played
m.top.Type = "Boxset"
2021-07-09 20:08:32 +00:00
setPoster()
end sub
2019-05-03 12:48:59 +00:00
sub setPoster()
2021-07-09 20:08:32 +00:00
if m.top.image <> invalid
m.top.posterURL = m.top.image.url
else
2021-07-09 20:08:32 +00:00
if m.top.json.ImageTags.Primary <> invalid
2022-05-22 22:41:02 +00:00
imgParams = { "maxHeight": 440, "maxWidth": 295 }
2021-07-09 20:08:32 +00:00
m.top.posterURL = ImageURL(m.top.json.id, "Primary", imgParams)
else if m.top.json.BackdropImageTags <> invalid
2022-05-22 22:41:02 +00:00
imgParams = { "maxHeight": 440 }
2021-07-09 20:08:32 +00:00
m.top.posterURL = ImageURL(m.top.json.id, "Backdrop", imgParams)
end if
2021-07-09 20:08:32 +00:00
' Add Backdrop Image
if m.top.json.BackdropImageTags <> invalid
2022-05-22 22:41:02 +00:00
imgParams = { "maxHeight": 720, "maxWidth": 1280 }
2021-07-09 20:08:32 +00:00
m.top.backdropURL = ImageURL(m.top.json.id, "Backdrop", imgParams)
end if
2021-07-09 20:08:32 +00:00
end if
2022-05-30 12:57:40 +00:00
end sub