Handle display of UserView libraries

This commit is contained in:
Neil Burrows 2020-03-23 16:14:26 +00:00
parent 3e1c7d1a63
commit 9570f51dc9
4 changed files with 7 additions and 5 deletions

View File

@ -15,7 +15,7 @@ sub setData()
' Set appropriate Images for Wide and Tall based on type ' Set appropriate Images for Wide and Tall based on type
if datum.type = "CollectionFolder" then if datum.type = "CollectionFolder" OR datum.type = "UserView" then
params = { "Tag" : datum.ImageTags.Primary, "maxHeight" : 261, "maxWidth" : 464 } params = { "Tag" : datum.ImageTags.Primary, "maxHeight" : 261, "maxWidth" : 464 }
m.top.thumbnailURL = ImageURL(datum.id, "Primary", params) m.top.thumbnailURL = ImageURL(datum.id, "Primary", params)
m.top.widePosterUrl = m.top.thumbnailURL m.top.widePosterUrl = m.top.thumbnailURL

View File

@ -22,7 +22,7 @@ sub itemContentChanged()
' Format the Data based on the type of Home Data ' Format the Data based on the type of Home Data
if itemData.type = "CollectionFolder" then if itemData.type = "CollectionFolder" OR itemData.type = "UserView" then
itemText.text = itemData.name itemText.text = itemData.name
itemPoster.uri = itemData.widePosterURL itemPoster.uri = itemData.widePosterURL
return return

View File

@ -67,7 +67,7 @@ sub Main()
else if isNodeEvent(msg, "selectedItem") else if isNodeEvent(msg, "selectedItem")
' If you select a library from ANYWHERE, follow this flow ' If you select a library from ANYWHERE, follow this flow
selectedItem = msg.getData() selectedItem = msg.getData()
if selectedItem.type = "CollectionFolder" AND selectedItem.collectionType = "movies" if (selectedItem.type = "CollectionFolder" OR selectedItem.type = "UserView") AND selectedItem.collectionType = "movies"
group.lastFocus = group.focusedChild group.lastFocus = group.focusedChild
group.setFocus(false) group.setFocus(false)
group.visible = false group.visible = false
@ -75,7 +75,7 @@ sub Main()
group = CreateMovieListGroup(selectedItem.Id) group = CreateMovieListGroup(selectedItem.Id)
group.overhangTitle = selectedItem.name group.overhangTitle = selectedItem.name
m.scene.appendChild(group) m.scene.appendChild(group)
else if selectedItem.type = "CollectionFolder" AND selectedItem.collectionType = "tvshows" else if (selectedItem.type = "CollectionFolder" OR selectedItem.type = "UserView") AND selectedItem.collectionType = "tvshows"
group.lastFocus = group.focusedChild group.lastFocus = group.focusedChild
group.setFocus(false) group.setFocus(false)
group.visible = false group.visible = false
@ -84,7 +84,7 @@ sub Main()
group = CreateSeriesListGroup(selectedItem.Id) group = CreateSeriesListGroup(selectedItem.Id)
group.overhangTitle = selectedItem.name group.overhangTitle = selectedItem.name
m.scene.appendChild(group) m.scene.appendChild(group)
else if selectedItem.type = "CollectionFolder" AND selectedItem.collectionType = "boxsets" else if (selectedItem.type = "CollectionFolder" OR selectedItem.type = "UserView") AND selectedItem.collectionType = "boxsets"
group.lastFocus = group.focusedChild group.lastFocus = group.focusedChild
group.setFocus(false) group.setFocus(false)
group.visible = false group.visible = false

View File

@ -73,6 +73,8 @@ function ItemList(library_id = invalid as string, params = {})
params["page"] = 1 params["page"] = 1
end if end if
params["parentid"] = library_id params["parentid"] = library_id
params["recursive"] = true
url = Substitute("Users/{0}/Items/", get_setting("active_user")) url = Substitute("Users/{0}/Items/", get_setting("active_user"))
resp = APIRequest(url, params) resp = APIRequest(url, params)
data = getJson(resp) data = getJson(resp)