[gnome-music/wip/pl-artists-fixes] player: Restart song instead of replay



commit 65c78b616b3c1a5851473be91a46e00fb77047e2
Author: Arnel A. Borja <arnelborja src gnome org>
Date:   Wed Apr 9 21:44:23 2014 +0800

    player: Restart song instead of replay
    
    Setting the scrollbar position to zero emits seeked signal and forces
    MPRIS clients to pickup the position change when the song is restarted.

 gnomemusic/player.py |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index 57de796..ea07c09 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -468,12 +468,14 @@ class Player(GObject.GObject):
             return
 
         position = self.get_position() / 1000000
+        if position >= 5:
+            self.progressScale.set_value(0)
+            self.on_progress_scale_change_value(self.progressScale)
+            return
 
         self.stop()
 
-        if position < 5:
-            self.currentTrack = self._get_previous_track()
-
+        self.currentTrack = self._get_previous_track()
         if self.currentTrack:
             self.play()
 


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