diff --git a/vrobbler/apps/scrobbles/models.py b/vrobbler/apps/scrobbles/models.py index 7ecec62..c0b4867 100644 --- a/vrobbler/apps/scrobbles/models.py +++ b/vrobbler/apps/scrobbles/models.py @@ -934,6 +934,17 @@ class Scrobble(TimeStampedModel): last_page = pages[-1] return last_page + @property + def get_media_source_url(self) -> str: + url = "" + if self.media_type == "Website": + url = self.media_obj.url + if self.media_type == "Task" and self.logdata.source_id: + url = self.media_obj.source_url_pattern.format( + id=self.logdata.source_id + ) + return url + @classmethod def create_or_update( cls, media, user_id: int, scrobble_data: dict, **kwargs diff --git a/vrobbler/templates/tasks/task_detail.html b/vrobbler/templates/tasks/task_detail.html index b110c7d..65dc796 100644 --- a/vrobbler/templates/tasks/task_detail.html +++ b/vrobbler/templates/tasks/task_detail.html @@ -60,7 +60,7 @@ {% for scrobble in object.scrobble_set.all|dictsortreversed:"timestamp" %}