Create callback for music data

This commit is contained in:
1hitsong 2022-05-15 20:08:14 -04:00
parent 00df907c94
commit 577569a26f

View File

@ -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"