2023-05-03 21:21:04 +00:00
|
|
|
import "pkg:/source/api/Image.brs"
|
|
|
|
import "pkg:/source/api/baserequest.brs"
|
|
|
|
import "pkg:/source/utils/config.brs"
|
|
|
|
|
2020-05-13 19:36:38 +00:00
|
|
|
sub setFields()
|
2021-07-09 20:08:32 +00:00
|
|
|
json = m.top.json
|
2020-05-13 19:36:38 +00:00
|
|
|
|
2021-07-09 20:08:32 +00:00
|
|
|
m.top.id = json.id
|
|
|
|
m.top.Title = json.name
|
|
|
|
m.top.Description = json.overview
|
|
|
|
m.top.favorite = json.UserData.isFavorite
|
|
|
|
m.top.watched = json.UserData.played
|
|
|
|
m.top.Type = "Video"
|
2020-05-13 19:36:38 +00:00
|
|
|
|
2021-07-09 20:08:32 +00:00
|
|
|
setPoster()
|
2020-05-13 19:36:38 +00:00
|
|
|
end sub
|
|
|
|
|
|
|
|
sub setPoster()
|
2021-07-09 20:08:32 +00:00
|
|
|
if m.top.image <> invalid
|
|
|
|
m.top.posterURL = m.top.image.url
|
|
|
|
else if m.top.json.ImageTags.Primary <> invalid
|
2022-12-26 20:42:50 +00:00
|
|
|
imgParams = { "maxHeight": 440, "maxWidth": 295, "Tag": m.top.json.ImageTags.Primary }
|
2021-07-09 20:08:32 +00:00
|
|
|
m.top.posterURL = ImageURL(m.top.json.id, "Primary", imgParams)
|
|
|
|
end if
|
2022-05-30 12:57:40 +00:00
|
|
|
end sub
|