Forráskód Böngészése

[scrobbling] Clean up a few more logs

Colin Powell 1 éve
szülő
commit
3b7498c419
2 módosított fájl, 8 hozzáadás és 10 törlés
  1. 1 8
      vrobbler/apps/scrobbles/models.py
  2. 7 2
      vrobbler/apps/scrobbles/utils.py

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

@@ -801,6 +801,7 @@ class Scrobble(TimeStampedModel):
                     "media_id": media.id,
                     "source": source,
                     "scrobble_data": scrobble_data,
+                    "percent_played": scrobble.percent_played,
                 },
             )
             return scrobble.update(scrobble_data)
@@ -1003,14 +1004,6 @@ class Scrobble(TimeStampedModel):
 
     def update_ticks(self, data) -> None:
         self.playback_position_seconds = data.get("playback_position_seconds")
-        logger.info(
-            f"[scrobbling] update ticks",
-            extra={
-                "scrobble_id": self.id,
-                "playback_position_seconds": self.playback_position_seconds,
-                "source": self.source,
-            },
-        )
         self.save(update_fields=["playback_position_seconds"])
 
     def finish_long_play(self):

+ 7 - 2
vrobbler/apps/scrobbles/utils.py

@@ -95,7 +95,8 @@ def check_scrobble_for_finish(
 
     if scrobble.media_type == "GeoLocation" and not force_finish:
         logger.info(
-            f"{scrobble.id} not complete, locations are ONLY completed when new one is created"
+            f"[scrobbling] not complete, locations are ONLY completed when new one is created, use force_finish",
+            extra={"scrobble_id": scrobble.id},
         )
         return
 
@@ -119,7 +120,11 @@ def check_scrobble_for_finish(
         )
     else:
         logger.info(
-            f"{scrobble.id} not complete at {scrobble.percent_played}%"
+            f"[scrobbling] not complete",
+            extra={
+                "scrobble_id": scrobble.id,
+                "percent_played": scrobble.percent_played,
+            },
         )