From 9570f51dc96865baf572bae42e40bebc90e70533 Mon Sep 17 00:00:00 2001 From: Neil Burrows Date: Mon, 23 Mar 2020 16:14:26 +0000 Subject: [PATCH] Handle display of UserView libraries --- components/data/HomeData.brs | 2 +- components/home/HomeItem.brs | 2 +- source/Main.brs | 6 +++--- source/api/Items.brs | 2 ++ 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/components/data/HomeData.brs b/components/data/HomeData.brs index 3b0952f6..2400c651 100644 --- a/components/data/HomeData.brs +++ b/components/data/HomeData.brs @@ -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 diff --git a/components/home/HomeItem.brs b/components/home/HomeItem.brs index 5051633c..02266b5a 100644 --- a/components/home/HomeItem.brs +++ b/components/home/HomeItem.brs @@ -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 diff --git a/source/Main.brs b/source/Main.brs index f49bb0f9..da52a185 100644 --- a/source/Main.brs +++ b/source/Main.brs @@ -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 diff --git a/source/api/Items.brs b/source/api/Items.brs index 41db7292..8a606e9a 100644 --- a/source/api/Items.brs +++ b/source/api/Items.brs @@ -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)