diff --git a/vrobbler/apps/music/models.py b/vrobbler/apps/music/models.py index d907fd7..6b96457 100644 --- a/vrobbler/apps/music/models.py +++ b/vrobbler/apps/music/models.py @@ -168,6 +168,15 @@ class Album(TimeStampedModel): track__in=self.track_set.all() ).order_by("-timestamp") + @property + def primary_image_url(self) -> str: + url = "" + if self.thumbnail: + url = self.thumbnail.url + if not url and self.album_set.first().cover_image: + url = self.album_set.first().cover_image.url + return url + @property def tracks(self): return ( diff --git a/vrobbler/templates/music/artist_detail.html b/vrobbler/templates/music/artist_detail.html index 1d75a70..266f972 100644 --- a/vrobbler/templates/music/artist_detail.html +++ b/vrobbler/templates/music/artist_detail.html @@ -9,7 +9,7 @@ {% if object.thumbnail %}
-
+