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"
|
|
|
|
|
2022-07-09 08:39:29 +00:00
|
|
|
sub setFields()
|
|
|
|
json = m.top.json
|
|
|
|
|
|
|
|
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 = json.Type
|
|
|
|
|
|
|
|
setPoster()
|
|
|
|
end sub
|
|
|
|
|
|
|
|
sub setPoster()
|
|
|
|
if m.top.image <> invalid
|
|
|
|
m.top.posterURL = m.top.image.url
|
|
|
|
else if m.top.json.ImageTags.Primary <> invalid
|
|
|
|
imgParams = { "maxHeight": 440, "maxWidth": 295 }
|
|
|
|
m.top.posterURL = ImageURL(m.top.json.id, "Primary", imgParams)
|
|
|
|
end if
|
|
|
|
end sub
|