[gnome-music/wip/jfelder/3-32-fix-repeat-all-one-song] player: Fix repeat all mode with only one song
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/3-32-fix-repeat-all-one-song] player: Fix repeat all mode with only one song
- Date: Wed, 24 Apr 2019 11:49:56 +0000 (UTC)
commit 67cab6f8a5c7283e559681c4ec17e1adb2d98e4a
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.
This is a backport based on commit de4b72c68ba9b8c24591a1670fcec943d14b8f59
gnomemusic/player.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index a2e7c89c..15ad9cf6 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -665,8 +665,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._repeat == RepeatMode.SONG):
+ or self._repeat 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]