Default to album art if artist not found

This commit is contained in:
2023-04-18 13:29:43 -04:00
parent bee9ac8d25
commit 8f4ce4441b
3 changed files with 11 additions and 2 deletions

View File

@ -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 (