remove spinner when quickplay api queries return no results + fix recording library bug

This commit is contained in:
Charles Ewert 2023-11-24 22:09:29 -05:00
parent 4043f3ef45
commit b4d5a4e6d3

View File

@ -84,6 +84,8 @@ namespace quickplay
photoPlayer.itemsArray = photoAlbumData.items
photoPlayer.itemIndex = 0
m.global.sceneManager.callfunc("pushScene", photoPlayer)
else
stopLoadingSpinner()
end if
end sub
@ -103,6 +105,8 @@ namespace quickplay
})
if isValid(albumSongs) and isValidAndNotEmpty(albumSongs.items)
quickplay.pushToQueue(albumSongs.items)
else
stopLoadingSpinner()
end if
end sub
@ -126,6 +130,8 @@ namespace quickplay
if isValid(artistSongs) and isValidAndNotEmpty(artistSongs.items)
quickplay.pushToQueue(artistSongs.items, true)
else
stopLoadingSpinner()
end if
end sub
@ -142,6 +148,8 @@ namespace quickplay
})
if isValid(data) and isValidAndNotEmpty(data.Items)
quickplay.pushToQueue(data.items)
else
stopLoadingSpinner()
end if
end sub
@ -197,6 +205,8 @@ namespace quickplay
if isValid(data) and isValidAndNotEmpty(data.Items)
' add all episodes found to a playlist
quickplay.pushToQueue(data.Items)
else
stopLoadingSpinner()
end if
end if
end if
@ -240,6 +250,8 @@ namespace quickplay
end for
if m.global.queueManager.callFunc("getCount") > 1
m.global.queueManager.callFunc("toggleShuffle")
else
stopLoadingSpinner()
end if
end if
end sub
@ -305,6 +317,8 @@ namespace quickplay
end if
end if
end if
else
stopLoadingSpinner()
end if
end sub
@ -345,6 +359,8 @@ namespace quickplay
if m.global.queueManager.callFunc("getCount") > 1
m.global.queueManager.callFunc("toggleShuffle")
else
stopLoadingSpinner()
end if
end sub
@ -352,8 +368,8 @@ namespace quickplay
sub tvChannel(itemNode as object)
if not isValid(itemNode) or not isValid(itemNode.id) then return
stopLoadingSpinner()
group = CreateVideoPlayerGroup(itemNode.id)
stopLoadingSpinner()
m.global.sceneManager.callFunc("pushScene", group)
end sub
@ -361,8 +377,8 @@ namespace quickplay
sub program(itemNode as object)
if not isValid(itemNode) or not isValid(itemNode.json) or not isValid(itemNode.json.ChannelId) then return
stopLoadingSpinner()
group = CreateVideoPlayerGroup(itemNode.json.ChannelId)
stopLoadingSpinner()
m.global.sceneManager.callFunc("pushScene", group)
end sub
@ -383,6 +399,8 @@ namespace quickplay
if m.global.queueManager.callFunc("getCount") > 1
m.global.queueManager.callFunc("toggleShuffle")
end if
else
stopLoadingSpinner()
end if
end sub
@ -451,6 +469,8 @@ namespace quickplay
quickplay.pushToQueue(folderData.items, true)
end if
end if
else
stopLoadingSpinner()
end if
end sub
@ -484,6 +504,8 @@ namespace quickplay
end if
end for
quickplay.pushToQueue(movieList)
else
stopLoadingSpinner()
end if
else if collectionType = "music"
' get audio files from under this collection
@ -501,6 +523,8 @@ namespace quickplay
print "songsData=", songsData
if isValid(songsData) and isValidAndNotEmpty(songsData.items)
quickplay.pushToQueue(songsData.Items, true)
else
stopLoadingSpinner()
end if
else if collectionType = "boxsets"
' get list of all boxsets inside
@ -529,6 +553,8 @@ namespace quickplay
if isValid(boxsetData) and isValidAndNotEmpty(boxsetData.items)
' add all boxset items to queue
quickplay.pushToQueue(boxsetData.Items)
else
stopLoadingSpinner()
end if
end if
else if collectionType = "tvshows" or collectionType = "collectionfolder"
@ -545,7 +571,15 @@ namespace quickplay
print "tvshowsData=", tvshowsData
if isValid(tvshowsData) and isValidAndNotEmpty(tvshowsData.items)
quickplay.multipleSeries(tvshowsData.items)
' the type of media returned from api may change.
if tvshowsData.items[0].Type = "Series"
quickplay.multipleSeries(tvshowsData.items)
else
' if first item is not a series, then assume they are all videos and/or episodes
quickplay.pushToQueue(tvshowsData.items)
end if
else
stopLoadingSpinner()
end if
else if collectionType = "musicvideos"
' get randomized list of videos inside
@ -562,6 +596,8 @@ namespace quickplay
print "data=", data
if isValid(data) and isValidAndNotEmpty(data.items)
quickplay.pushToQueue(data.Items)
else
stopLoadingSpinner()
end if
else if collectionType = "homevideos"
' Photo library - items can be type video, photo, or photoAlbum
@ -582,6 +618,8 @@ namespace quickplay
photoPlayer.itemsArray = folderData.items
photoPlayer.itemIndex = 0
m.global.sceneManager.callfunc("pushScene", photoPlayer)
else
stopLoadingSpinner()
end if
else
stopLoadingSpinner()
@ -622,6 +660,8 @@ namespace quickplay
' validate api results
if isValid(playlistItems) and isValidAndNotEmpty(playlistItems.items)
quickplay.pushToQueue(playlistItems.items, true)
else
stopLoadingSpinner()
end if
end if
else if collectionType = "livetv"
@ -644,6 +684,8 @@ namespace quickplay
print "myChannel=", myChannel
' play channel
quickplay.tvChannel(myChannel)
else
stopLoadingSpinner()
end if
else
stopLoadingSpinner()