[gnome-music/wip/mschraal/player-factor-out-gstreamer] player: Correct scrobbling rules



commit 5b14d5b2c0506e127b605acfd89783f75bb7057e
Author: Marinus Schraal <mschraal gnome org>
Date:   Sun Feb 18 00:39:05 2018 +0100

    player: Correct scrobbling rules

 gnomemusic/player.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index 8de892c..972cf82 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -644,11 +644,13 @@ class Player(GObject.GObject):
         position = self._player.position
         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
-                        and percentage > 0.4):
-                    current_media = self.get_current_media()
+                        and duration > 30
+                        and (percentage > 0.5 or tick > 4*60)):
                     if current_media:
                         # FIXME: we should not need to update static
                         # playlists here but removing it may introduce


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