Merge pull request #166 from neilsb/handle-displaying-userviews

Handle display of UserView libraries
This commit is contained in:
Charles Ewert 2020-03-23 13:41:45 -04:00 committed by GitHub
commit ee6cd0491c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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
if datum.type = "CollectionFolder" then
if datum.type = "CollectionFolder" OR datum.type = "UserView" then
params = { "Tag" : datum.ImageTags.Primary, "maxHeight" : 261, "maxWidth" : 464 }
m.top.thumbnailURL = ImageURL(datum.id, "Primary", params)
m.top.widePosterUrl = m.top.thumbnailURL

View File

@ -22,7 +22,7 @@ sub itemContentChanged()
' 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
itemPoster.uri = itemData.widePosterURL
return

View File

@ -67,7 +67,7 @@ sub Main()
else if isNodeEvent(msg, "selectedItem")
' If you select a library from ANYWHERE, follow this flow
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.setFocus(false)
group.visible = false
@ -75,7 +75,7 @@ sub Main()
group = CreateMovieListGroup(selectedItem.Id)
group.overhangTitle = selectedItem.name
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.setFocus(false)
group.visible = false
@ -84,7 +84,7 @@ sub Main()
group = CreateSeriesListGroup(selectedItem.Id)
group.overhangTitle = selectedItem.name
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.setFocus(false)
group.visible = false

View File

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