Merge pull request #426 from jd1123/folderimage

This commit is contained in:
Neil Burrows 2021-04-21 20:09:46 +01:00 committed by GitHub
commit 5c862aa6b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 0 deletions

View File

@ -42,6 +42,7 @@ sub itemContentChanged()
m.itemPoster.uri = itemData.PosterUrl
m.itemText.text = itemData.Title
else if itemData.type = "Folder" then
m.itemPoster.uri = itemData.PosterUrl
m.itemIcon.uri = itemData.iconUrl
m.itemText.text = itemData.Title
else if itemData.type = "Video" then

View File

@ -6,4 +6,19 @@ sub setFields()
m.top.Type = "Folder"
m.top.iconUrl = "pkg:/images/media_type_icons/folder_white.png"
' This is a temporary measure to avoid displaying landscape photos
' 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
end sub
sub setPoster()
if m.top.image <> invalid
m.top.posterURL = m.top.image.url
else if m.top.json.ImageTags.Primary <> invalid then
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

View File

@ -1,4 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<component name="FolderData" extends="JFContentItem">
<script type="text/brightscript" uri="FolderData.brs" />
<script type="text/brightscript" uri="pkg:/source/api/Image.brs" />
<script type="text/brightscript" uri="pkg:/source/api/baserequest.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
</component>