[gnome-music/wip/jfelder/3-34-mpris-loopstatus-getter] mpris: Fix LoopStatus getter



commit fc292266608a86ecf688bc7cac6a3a673e882c17
Author: Jean Felder <jfelder src gnome org>
Date:   Sun Nov 3 21:03:31 2019 +0100

    mpris: Fix LoopStatus getter
    
    According to MPRIS specifications, LoopStatus may be:
    - "None" if the playback will stop when there are no more tracks to
    play. This matches RepeatMode.{NONE,SHUFFLE} in GNOME Music.
    - "Track" if the current track will start again from the begining once
    it has finished playing. This matches RepeatMode.SONG in GNOME Music.
    - "Playlist" if the playback loops through a list of tracks. This
    matches RepeatMode.ALL in GNOME Music.
    
    In shuffle mode, the current LoopStatus getter returns "Playlist"
    instead of "None".
    
    This issue is fixed by updating the getter to return the correct
    values.
    
    (cherry picked from commit 04180ba72b37a7cd21f705778828e8e95da11d73)

 gnomemusic/mpris.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gnomemusic/mpris.py b/gnomemusic/mpris.py
index a7e0930e..b9af87fe 100644
--- a/gnomemusic/mpris.py
+++ b/gnomemusic/mpris.py
@@ -325,12 +325,12 @@ class MPRIS(DBusInterface):
 
     @log
     def _get_loop_status(self):
-        if self._player.props.repeat_mode == RepeatMode.NONE:
-            return 'None'
+        if self._player.props.repeat_mode == RepeatMode.ALL:
+            return "Playlist"
         elif self._player.props.repeat_mode == RepeatMode.SONG:
             return 'Track'
         else:
-            return 'Playlist'
+            return "None"
 
     @log
     def _get_metadata(self, coresong=None, index=None):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]