Handle the loading state whilst appending many tracks better

1) Update the queue length periodically so that the user can see we're
   working
2) Clear any previous track and display "loading..." instead
This commit is contained in:
jacqueline
2024-08-28 04:07:21 +00:00
committed by cooljqln
parent d3c15bf070
commit 9ec8d6dafc
6 changed files with 39 additions and 3 deletions
+12 -1
View File
@@ -226,7 +226,18 @@ return screen:new {
end
end),
playback.track:bind(function(track)
if not track then return end
if not track then
if queue.loading:get() then
title:set { text = "Loading..." }
else
title:set { text = "" }
end
artist:set { text = "" }
cur_time:set { text = format_time(0) }
end_time:set { text = format_time(0) }
scrubber:set { value = 0 }
return
end
if track.duration then
end_time:set { text = format_time(track.duration) }
else