Merge pull request #1166 from 1hitsong/homeCollections

Support favorited collections on home view
This commit is contained in:
1hitsong 2023-04-20 07:22:09 -04:00 committed by GitHub
commit 5f17467d62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 1 deletions

View File

@ -166,6 +166,20 @@ sub itemContentChanged()
return
end if
if itemData.type = "BoxSet"
m.itemText.text = itemData.name
m.itemPoster.uri = itemData.posterURL
' Set small text to number of items in the collection
if isValid(itemData.json) and isValid(itemData.json.ChildCount)
m.itemTextExtra.text = StrI(itemData.json.ChildCount).trim() + " item"
if itemData.json.ChildCount > 1
m.itemTextExtra.text += "s"
end if
end if
return
end if
if itemData.type = "Series"
m.itemText.text = itemData.name

View File

@ -132,6 +132,12 @@ sub loadItems()
' Skip Books for now as we don't support it (issue #558)
if item.Type <> "Book"
tmp = CreateObject("roSGNode", "HomeData")
params = {}
params["Tags"] = item.PrimaryImageTag
params["MaxWidth"] = 234
params["MaxHeight"] = 330
tmp.posterURL = ImageUrl(item.Id, "Primary", params)
tmp.json = item
results.push(tmp)
end if

View File

@ -158,7 +158,7 @@ sub Main (args as dynamic) as void
m.selectedItemType = selectedItem.type
if selectedItem.type = "CollectionFolder"
if selectedItem.type = "CollectionFolder" or selectedItem.type = "BoxSet"
if selectedItem.collectionType = "movies"
group = CreateMovieLibraryView(selectedItem)
else if selectedItem.collectionType = "music"