Explorar el Código

Add hack to fix Mopidy progress

Colin Powell hace 2 años
padre
commit
879357473a
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      vrobbler/apps/scrobbles/models.py

+ 5 - 1
vrobbler/apps/scrobbles/models.py

@@ -42,7 +42,11 @@ class Scrobble(TimeStampedModel):
 
     @property
     def percent_played(self) -> int:
-        if self.playback_position_ticks and self.media_obj.run_time_ticks:
+        if (
+            self.playback_position_ticks
+            and self.media_obj.run_time_ticks
+            and source != 'Mopidy'
+        ):
             return int(
                 (self.playback_position_ticks / self.media_obj.run_time_ticks)
                 * 100