From 829d033a448107f1bc610cf735ce9f7222de564b Mon Sep 17 00:00:00 2001 From: ailurux Date: Tue, 7 Jan 2025 00:00:00 +0000 Subject: 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 Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/170 Reviewed-by: cooljqln Co-authored-by: ailurux Co-committed-by: ailurux --- lua/playing.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lua/playing.lua') 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 -- cgit v1.2.3