Przeglądaj źródła

[brickset] Little fix to scrobble of bricksets

Colin Powell 5 miesięcy temu
rodzic
commit
356e579558

+ 6 - 0
vrobbler/apps/bricksets/models.py

@@ -50,6 +50,12 @@ class BrickSet(LongPlayScrobblableMixin):
     def get_absolute_url(self):
         return reverse("bricksets:brickset_detail", kwargs={"slug": self.uuid})
 
+    def __str__(self) -> str:
+        name = str(self.title)
+        if not self.title:
+            name = str(self.number)
+        return name
+
     @property
     def logdata_cls(self):
         return BrickSetLogData

+ 2 - 0
vrobbler/apps/scrobbles/scrobblers.py

@@ -870,6 +870,7 @@ def manual_scrobble_brickset(
         "timestamp": timezone.now(),
         "playback_position_seconds": 0,
         "source": "Vrobbler",
+        "log": {"serial_scrobble_id": ""},
     }
     logger.info(
         "[vrobbler-scrobble] brickset scrobble request received",
@@ -882,4 +883,5 @@ def manual_scrobble_brickset(
     )
 
     # TODO Kick out a process to enrich the media here, and in every scrobble event
+    # TODO Need to check for past scrobbles and auto populate serial scrobble id if possible
     return Scrobble.create_or_update(brickset, user_id, scrobble_dict)