quodlibet icon indicating copy to clipboard operation
quodlibet copied to clipboard

Flaky "toogle shuffle mode" button state

Open rumatoest opened this issue 1 year ago • 1 comments

Steps to reproduce

Launch quodlibet with LANG=ru or LANG=de Initially I've observed this issue with "ru" locale and "playcounteq" extension. Than I figured out that is the same for any extension. Later somehow it start reproducing on "en" locale too.

Enable some "Play order" plugins

Select plugin in the list for "toogle shuffle mode" button and activate button (toggle on)

Close application

Open application - plugin is still selected in the list but the button is not active (not toggled on)

Expected Output

"toogle shuffle mode" button should save state before app is closing and restore it on the next start

Test System

Which version of Quod Libet?

4.7 development and 4.6.0 Behavior could be different between these 2 versions. I've launched app multiple times and tried to clean ~/.config/quodlibet/* And sometimes I was able to make it work as it should be for 4.6.0 and en locale.

I have another setup on Debian and it looks like it worked there there, but I do not have access to this PC right now so I can not tell you exact version.

Which operating system

Manjaro Linux with KDE desktop

Debug Information

I've tracked with behaviour to

quodlibet/plugins/init.py

        if not status:
            print_d("Disable %r" % plugin.id)
            for handler in plugin.handlers:
                handler.plugin_disable(plugin)

quodlibet/qltk/playorder.py

    def plugin_disable(self, plugin):
        self.remove(plugin.cls)

BTW Try add print_d here

    def __shuffle_toggled(self, widget):
        if self.__inhibit:
            return
        print_d("SET ENABLED {}".format(widget.enabled))
        config.set("memory", "shuffle", widget.enabled)
        self.__compose_order()

So now while app is closing I see next logs

D: [0000.000] main.before_quit: Saving active browser state
D: [0000.000] main.before_quit: Shutting down player device 'GStreamer: 1.22.10.0'.
D: [0000.000] player.gstbe.player.__destroy_pipeline: Destroying Gstreamer pipeline
D: [0000.000] PluginManager.save: Saving plugins: 2 active
D: [0000.000] PluginManager.enable: Disable 'playcounteq'
D: [0000.000] qltk.playorder.__shuffle_toggled: SET ENABLED False
D: [0000.000] qltk.playorder.__compose_order: Updating PlaylistModel order to <Repeat this track ∘ In Order>
D: [0000.000] PluginManager.enable: Disable 'Shuffle by Grouping'
D: [0000.000] qltk.playorder.__shuffle_toggled: SET ENABLED False
D: [0000.000] qltk.playorder.__compose_order: Updating PlaylistModel order to <Repeat this track ∘ In Order>

So it looks like when app is closing plugins are disabled and widget button is toggled to off. Then this new toggle state is saved to config.set("memory", "shuffle", widget.enabled) thus while application is launched again widget button will not be enabled.

Also this is what I see in my configuration.

And I can see another issue here. shuffle_mode saves plugin localized name in the configuration but it should save plugin ID instead.

seek = 0
shuffle = False
shuffle_mode = Уравнитель прослушиваний
sidebar_pos = 0.25
sortby = 0~#track

rumatoest avatar Mar 12 '24 10:03 rumatoest

Guess this issue is the same as #4184

rumatoest avatar Mar 24 '24 12:03 rumatoest

Closing as duplicate of #4184 then

declension avatar Jun 07 '24 21:06 declension