[gnome-music/wip/mschraal/player-factor-out-gstreamer] player: Set local rule for play count



commit 4c86f8f8a8e632695e412b23e8e33b56ea1f2c46
Author: Marinus Schraal <mschraal gnome org>
Date:   Sun Feb 18 00:45:41 2018 +0100

    player: Set local rule for play count
    
    Set it to 50% of the track played for now.

 gnomemusic/player.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index 73112d9..8e67ef7 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -650,13 +650,15 @@ class Player(GObject.GObject):
             if (not self._lastfm.scrobbled
                     and duration > 30
                     and (percentage > 0.5 or tick > 4*60)):
+                self._lastfm.scrobble(current_media, self._time_stamp)
+
+            if percentage > 0.5:
                 # FIXME: we should not need to update static
                 # playlists here but removing it may introduce
                 # a bug. So, we keep it for the time being.
                 playlists.update_all_static_playlists()
                 grilo.bump_play_count(current_media)
                 grilo.set_last_played(current_media)
-                self._lastfm.scrobble(current_media, self._time_stamp)
 
     @log
     def _on_play_button_clicked(self, button):


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