[gnome-music/wip/jfelder/fix-one-song-repeat-all: 3/3] player: Fix repeat all mode with only one song



commit de4b72c68ba9b8c24591a1670fcec943d14b8f59
Author: Jean Felder <jfelder src gnome org>
Date:   Tue Apr 23 23:09:14 2019 +0200

    player: Fix repeat all mode with only one song
    
    Commits 7a7db137 and b6467bf4 fixed an issue with the player: it was
    impossible to change the current song when the player was on
    pause. However, it broke the repeat song mode and repeat all mode if
    the playlist has only one song.
    Indeed, at the end of a song, a new song is loaded only if the song
    url has changed. But, if the repeat all mode is set and the playlist
    has only one song, the url is unchanged.
    
    The repeat song case had already been solved by commit fcebe9ec.
    Adding a check to test if the repeat mode is in a
    loop (RepeatMode.SONG or RepeatMode.ALL is set) fixes the issue for
    both cases.
    
    Closes: #278

 gnomemusic/player.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index dedbccfe..6343950a 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -642,8 +642,9 @@ class Player(GObject.GObject):
             return False
 
         url = self._playlist.props.current_song.get_url()
+        loop_modes = [RepeatMode.SONG, RepeatMode.ALL]
         if (url != self._gst_player.props.url
-                or self.props.repeat_mode == RepeatMode.SONG):
+                or self.props.repeat_mode in loop_modes):
             self._load(self._playlist.props.current_song)
 
         self._gst_player.props.state = Playback.PLAYING


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