[gnome-music] mpris: Seek to start when a song is loaded and in repeat song mode



commit 0da31ab5d1d84c6272d74b9176239b31b5859112
Author: Arnel A. Borja <arnelborja src gnome org>
Date:   Sat Sep 14 22:36:13 2013 +0800

    mpris: Seek to start when a song is loaded and in repeat song mode
    
    This makes sure that the current position will be reset when replaying
    the song. This seems like it doesn't follow the MPRIS specifications (no
    seeking when the media changes), but other media players do this too, so
    do it anyway.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=703303

 gnomemusic/mpris.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gnomemusic/mpris.py b/gnomemusic/mpris.py
index 6f42ea3..53cdd78 100644
--- a/gnomemusic/mpris.py
+++ b/gnomemusic/mpris.py
@@ -112,6 +112,9 @@ class MediaPlayer2Service(dbus.service.Object):
         return metadata
 
     def _on_current_changed(self, player, data=None):
+        if self.player.repeat == RepeatType.SONG:
+            self.Seeked(0)
+
         self.PropertiesChanged(self.MEDIA_PLAYER2_PLAYER_IFACE,
                                {
                                    'Metadata': dbus.Dictionary(self._get_metadata(),


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