Quodlibet: Previous track button doesn't work properly with shuttle mode enabled

Created on 8 Jan 2019  路  5Comments  路  Source: quodlibet/quodlibet

Steps to reproduce

  1. Enable shuttle mode
  2. Press previous track twice.

Expected Output

Previous song should be playing.

Actual Output

Current playing song is set at 0:00.

Test System

Which version of Quod Libet?

5c683a1ba2924a1c5f88797bea7d212f7472ec51

Which operating system

Fedora 29

Additional Information

The issue got introduced by commit id 1e9e848b5777e178618cfbb344b20267d317d19f and I can /fix/ my issue by doing this. I'm unsure if this is a valid fix therefore I'm opening a bug report instead of submitting this in a pull request.

diff --git a/quodlibet/quodlibet/qltk/songmodel.py b/quodlibet/quodlibet/qltk/songmodel.py
index 3e7ef5a56..b675dcc57 100644
--- a/quodlibet/quodlibet/qltk/songmodel.py
+++ b/quodlibet/quodlibet/qltk/songmodel.py
@@ -96,7 +96,7 @@ class PlaylistMux(object):

         if q_disable or self.pl.sourced or not keep_songs:
             self.pl.previous()
-            self.go_to(self.pl.current)
+            # self.go_to(self.pl.current)
         else:
             self.q.previous()
         self._check_sourced()
-- 
bug

All 5 comments

I'm not able to reproduce this.

Does this happen for every song, both in the song list and in the queue? Also, what's your queue settings, and do you get any output when pressing previous while running QL in debug mode (./quodlibet --debug)? (If so, please post it here.)

I'm unsure if this is a valid fix

Removing that line will introduce a bug where the song list will not begin playing if first sourcing from the queue in persistent mode, then disabling the queue, and finally pressing previous a couple of times.

I'm not able to reproduce this.

Oh, it looks like it only reproducible if you have shuffle mode enabled.

Also, what's your queue settings, and do you get any output when pressing previous while running QL in debug mode (./quodlibet --debug)? (If so, please post it here.)

I don't really see anything that important in debug output. I'll post it here if you won't be able to reproduce it again after enabling shuffle mode.

I can reproduce it now, thanks. I'll try to come up with a fix.

I think the following should fix it. Feel free to test it.

diff --git a/quodlibet/quodlibet/qltk/songmodel.py b/quodlibet/quodlibet/qltk/songmodel.py
index 3e7ef5a56..769c9cb48 100644
--- a/quodlibet/quodlibet/qltk/songmodel.py
+++ b/quodlibet/quodlibet/qltk/songmodel.py
@@ -66,9 +66,10 @@ class PlaylistMux(object):
                 or q_disable
                 or (keep_songs and not self.q.sourced)):
             self.pl.next()
-            # The go_to is to make sure the playlist begins playing
-            # when the queue is disabled while being sourced
-            self.go_to(self.pl.current)
+            if q_disable and self.q.sourced:
+                # The go_to is to make sure the playlist begins playing
+                # when the queue is disabled while being sourced
+                self.go_to(self.pl.current)
         else:
             self.q.next()
         self._check_sourced()
@@ -83,7 +84,8 @@ class PlaylistMux(object):
                 or q_disable
                 or (keep_songs and not self.q.sourced)):
             self.pl.next_ended()
-            self.go_to(self.pl.current)
+            if q_disable and self.q.sourced:
+                self.go_to(self.pl.current)
         else:
             self.q.next_ended()
         self._check_sourced()
@@ -96,7 +98,8 @@ class PlaylistMux(object):

         if q_disable or self.pl.sourced or not keep_songs:
             self.pl.previous()
-            self.go_to(self.pl.current)
+            if q_disable and self.q.sourced:
+                self.go_to(self.pl.current)
         else:
             self.q.previous()
         self._check_sourced()

It seems to work properly here~

Was this page helpful?
0 / 5 - 0 ratings