GNOME Bugzilla – Bug 765609
MPRIS: Setting Shuffle raises an exception
Last modified: 2016-05-12 15:55:16 UTC
Steps to reproduce: 1. Set shuffle manually in the player 2. Try setting shuffle to On using an MPRIS client. Exception: Traceback (most recent call last):
+ Trace 236207
result = getattr(self, method_name)(*args)
self.set_repeat_mode(RepeatType.NONE)
Created attachment 326770 [details] [review] mpris: fix method call to set_repeat_mode
Review of attachment 326770 [details] [review]: Oversight by the original author it seems, no-one ever noticed. Looks ok to me.
Review of attachment 326770 [details] [review]: I'm flip-flopping a bit, sorry. ::: gnomemusic/mpris.py @@ +752,3 @@ if (new_value and self.player.get_repeat_mode() != RepeatType.SHUFFLE): + self.player.set_repeat_mode(RepeatType.SHUFFLE) + elif not new_value and self.player.get_repeat_mode() == RepeatType.SHUFFLE: Why does this go from 'elif new_value' to 'elif not new_value'. I assume from your code that new_value is a bool (0 or 1?) that is either off or on depending on if shuffle is wanted or not. Why not write if new_value set_repeat_mode(SHUFFLE) else set_repeat_mode(None)
Created attachment 327690 [details] [review] mpris: fix method call to set_repeat_mode My bad, I just stuck with the semantics of the old code. The second part of the if condition isn't really necessary. Resubmitted the patch.
Review of attachment 327690 [details] [review]: Looks fine.
Thanks for the patch, committed. This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.