From e4738e464fe6c9fd15f98db87fa17295c892ac97 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Mon, 9 Sep 2024 17:20:10 -0400 Subject: [PATCH] [trails] Finish hooking things up for trails --- vrobbler/apps/scrobbles/constants.py | 1 + vrobbler/apps/scrobbles/mixins.py | 3 +++ vrobbler/apps/scrobbles/models.py | 2 ++ 3 files changed, 6 insertions(+) diff --git a/vrobbler/apps/scrobbles/constants.py b/vrobbler/apps/scrobbles/constants.py index 9a63d24..8089b4e 100644 --- a/vrobbler/apps/scrobbles/constants.py +++ b/vrobbler/apps/scrobbles/constants.py @@ -15,6 +15,7 @@ PLAY_AGAIN_MEDIA = { "boardgames": "BoardGame", "moods": "Mood", "bricksets": "BrickSet", + "trails": "Trail", } MEDIA_END_PADDING_SECONDS = { diff --git a/vrobbler/apps/scrobbles/mixins.py b/vrobbler/apps/scrobbles/mixins.py index 6aa454c..243e38f 100644 --- a/vrobbler/apps/scrobbles/mixins.py +++ b/vrobbler/apps/scrobbles/mixins.py @@ -75,6 +75,9 @@ class ScrobblableMixin(TimeStampedModel): ) return Scrobble.create_or_update(self, user_id, scrobble_data) + def get_start_url(self): + return reverse("scrobbles:start", kwargs={"uuid": self.uuid}) + @property def primary_image_url(self) -> str: logger.warning(f"Not implemented yet") diff --git a/vrobbler/apps/scrobbles/models.py b/vrobbler/apps/scrobbles/models.py index abad82d..9fd0f12 100644 --- a/vrobbler/apps/scrobbles/models.py +++ b/vrobbler/apps/scrobbles/models.py @@ -891,6 +891,8 @@ class Scrobble(TimeStampedModel): media_obj = self.mood if self.brickset: media_obj = self.brickset + if self.trail: + media_obj = self.trail return media_obj def __str__(self):