From 577569a26f3e0377eda70cee818b4ae145a5c27e Mon Sep 17 00:00:00 2001 From: 1hitsong <3330318+1hitsong@users.noreply.github.com> Date: Sun, 15 May 2022 20:08:14 -0400 Subject: [PATCH] Create callback for music data --- components/ItemGrid/LoadItemsTask2.brs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/components/ItemGrid/LoadItemsTask2.brs b/components/ItemGrid/LoadItemsTask2.brs index b6bdfadd..f779cb19 100644 --- a/components/ItemGrid/LoadItemsTask2.brs +++ b/components/ItemGrid/LoadItemsTask2.brs @@ -53,11 +53,22 @@ sub loadItems() url = Substitute("Users/{0}/Items/", get_setting("active_user")) end if resp = APIRequest(url, params) - data = getJson(resp) + data = getJson(resp) + if data <> invalid if data.TotalRecordCount <> invalid then m.top.totalRecordCount = data.TotalRecordCount + ' When loading the music collection, if no artists are found, try searching by albums + if m.top.collectionType = "music" + if m.top.ItemType = "MusicArtist" + if data.TotalRecordCount = 0 + m.top.ItemType = "MusicAlbum" + loadItems() + end if + end if + end if + for each item in data.Items tmp = invalid if item.Type = "Movie"