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-10-30 17:23:28 +00:00
|
|
|
sub setFields()
|
|
|
|
json = m.top.json
|
|
|
|
|
|
|
|
m.top.id = json.id
|
|
|
|
m.top.Title = json.name
|
|
|
|
m.top.Type = "Folder"
|
|
|
|
|
|
|
|
m.top.iconUrl = "pkg:/images/media_type_icons/folder_white.png"
|
2021-04-21 01:26:50 +00:00
|
|
|
' This is a temporary measure to avoid displaying landscape photos
|
2021-07-09 20:08:32 +00:00
|
|
|
' in GridItem components that only support portrait. It will be fixed
|
|
|
|
' after the ItemGrid is reworked.
|
|
|
|
if m.top.json.Type <> "CollectionFolder"
|
|
|
|
setPoster()
|
|
|
|
end if
|
2021-04-19 02:27:11 +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
|
2022-07-09 08:39:29 +00:00
|
|
|
else if m.top.json.Type = "Studio"
|
|
|
|
imgParams = { "maxHeight": 440, "maxWidth": 295, "Tag": m.top.json.ParentThumbImageTag }
|
|
|
|
m.top.posterURL = ImageURL(m.top.json.id, "Thumb", imgParams)
|
2021-07-09 20:08:32 +00:00
|
|
|
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
|
2020-10-30 17:23:28 +00:00
|
|
|
end sub
|
2022-07-09 08:39:29 +00:00
|
|
|
|
|
|
|
'TODO Set network Poster image
|