jf-roku/components/data/ChannelData.bs

25 lines
794 B
Plaintext
Raw Normal View History

import "pkg:/source/api/Image.bs"
import "pkg:/source/api/baserequest.bs"
import "pkg:/source/utils/config.bs"
sub setFields()
json = m.top.json
m.top.id = json.id
2020-11-23 17:13:57 +00:00
m.top.title = json.name
2020-10-17 19:23:20 +00:00
m.top.live = true
m.top.Type = "TvChannel"
setPoster()
end sub
sub setPoster()
if m.top.image <> invalid
m.top.posterURL = m.top.image.url
else if m.top.json.ImageTags <> invalid and m.top.json.ImageTags.Primary <> invalid
imgParams = { "maxHeight": 60, "Tag": m.top.json.ImageTags.Primary }
2022-05-14 10:13:28 +00:00
m.top.hdsmalliconurl = ImageURL(m.top.json.id, "Primary", imgParams)
imgParams = { "maxHeight": 440, "maxWidth": 295, "Tag": m.top.json.ImageTags.Primary }
m.top.posterURL = ImageURL(m.top.json.id, "Primary", imgParams)
end if
end sub