summaryrefslogtreecommitdiff
path: root/lua/playing.lua
diff options
context:
space:
mode:
authorailurux <ailuruxx@gmail.com>2025-01-07 00:00:00 +0000
committercooljqln <cooljqln@noreply.codeberg.org>2025-01-07 00:00:00 +0000
commit829d033a448107f1bc610cf735ce9f7222de564b (patch)
tree25efd26b3cd5d3a3f8e1c9486e2c2da0dce74d0f /lua/playing.lua
parent4ad5f1b63761f042734d1cc1eab2649186092ee5 (diff)
downloadtangara-fw-829d033a448107f1bc610cf735ce9f7222de564b.tar.gz
Improvements to the queue for shuffling/playing all (#170)
Queue now has a separate 'ready' property to indicate it's ready to be used, which is independent from whether it's still loading tracks in. This also improves the response time for shuffling all tracks (we will initially pick a random track in the first 100 tracks whilst the rest of the tracks are loading). This should also fix issues where one song will start playing and then repeat itself when the queue finishes loading, and hopefully solve #160 as well (though I couldn't actually repro this myself). Co-authored-by: jacqueline <me@jacqueline.id.au> Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/170 Reviewed-by: cooljqln <cooljqln@noreply.codeberg.org> Co-authored-by: ailurux <ailuruxx@gmail.com> Co-committed-by: ailurux <ailuruxx@gmail.com>
Diffstat (limited to 'lua/playing.lua')
-rw-r--r--lua/playing.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/lua/playing.lua b/lua/playing.lua
index e986273c..a5503c6a 100644
--- a/lua/playing.lua
+++ b/lua/playing.lua
@@ -267,11 +267,15 @@ return screen:new {
scrubber:set { value = pos / track.duration * 100 }
end
end),
+ queue.ready:bind(function(ready)
+ if not ready then
+ title:set { text = "Loading..." }
+ album:set{text=""}
+ artist:set{text=""}
+ end
+ end),
playback.track:bind(function(track)
if not track then
- if queue.loading:get() then
- title:set { text = "Loading..." }
- end
return
end
if track.duration then