[gnome-music/wip/mschraal/player-factor-out-gstreamer] player: Move lastfm now_playing call



commit 150163c02eb517f1fcb9107d9a71e5c312633f8d
Author: Marinus Schraal <mschraal gnome org>
Date:   Sun Feb 18 00:42:08 2018 +0100

    player: Move lastfm now_playing call

 gnomemusic/player.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index 972cf82..7c984c1 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -485,10 +485,6 @@ class Player(GObject.GObject):
             self.load(media)
 
         self._player.state = Playback.PLAYING
-
-        if media:
-            self._lastfm.now_playing(media)
-
         self.emit('playback-status-changed')
 
     @log
@@ -637,6 +633,11 @@ class Player(GObject.GObject):
         seconds = int(self._player.position)
         print("TICK", tick, seconds, self._player.position)
 
+        current_media = self.get_current_media()
+
+        if tick == 0:
+            self._lastfm.now_playing(current_media)
+
         self._progress_time_label.set_label(
             utils.seconds_to_string(seconds))
 
@@ -645,7 +646,6 @@ class Player(GObject.GObject):
         if position > 0:
             self.played_seconds += self._seconds_period / 1000
 
-            current_media = self.get_current_media()
             try:
                 percentage = tick / duration
                 if (not self._lastfm.scrobbled


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