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



commit 0cc3cfc42b44de202f495ecde88ceaf493e01961
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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index 21a3faca..0ba21f18 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -643,7 +643,7 @@ class Player(GObject.GObject):
 
         url = self._playlist.props.current_song.get_url()
         if (url != self._gst_player.props.url
-                or self.props.repeat_mode == RepeatMode.SONG):
+                or self.props.repeat_mode >= RepeatMode.SONG):
             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]