Default to album art if artist not found
This commit is contained in:
@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user