Parcourir la source

Stop location scrobbles properly

Colin Powell il y a 1 an
Parent
commit
96ca2f5602
1 fichiers modifiés avec 3 ajouts et 3 suppressions
  1. 3 3
      vrobbler/apps/scrobbles/models.py

+ 3 - 3
vrobbler/apps/scrobbles/models.py

@@ -703,9 +703,9 @@ class Scrobble(TimeStampedModel):
                         f"No - We've moved, start a new scrobble: {self.media_obj}"
                     )
                     # TODO maybe this should go to `update`?
-                    last = self.previous_all
-                    last.played_to_completion = True
-                    last.save(update_fields=["played_to_completion"])
+                    self.played_to_completion = True
+                    self.stop_timestamp = timezone.now()
+                    self.save(update_fields=["played_to_completion", "stop_timestamp"])
                     updatable = False
         return updatable