From 356e579558f91c3494d733b26b249c0c0267549e Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Mon, 9 Jun 2025 10:40:12 -0400 Subject: [PATCH] [brickset] Little fix to scrobble of bricksets --- vrobbler/apps/bricksets/models.py | 6 ++++++ vrobbler/apps/scrobbles/scrobblers.py | 2 ++ 2 files changed, 8 insertions(+) diff --git a/vrobbler/apps/bricksets/models.py b/vrobbler/apps/bricksets/models.py index 29f9a6f..d1ded0b 100644 --- a/vrobbler/apps/bricksets/models.py +++ b/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 diff --git a/vrobbler/apps/scrobbles/scrobblers.py b/vrobbler/apps/scrobbles/scrobblers.py index bd1ffb2..08ed785 100644 --- a/vrobbler/apps/scrobbles/scrobblers.py +++ b/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)