Ooops. Set artist image on actual model
This commit is contained in:
@ -39,6 +39,14 @@ class Artist(TimeStampedModel):
|
|||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
@property
|
||||||
|
def primary_image_url(self) -> str:
|
||||||
|
if self.thumbnail:
|
||||||
|
return self.thumbnail.url
|
||||||
|
if self.album_set.first().cover_image:
|
||||||
|
return self.album_set.first().cover_image.url
|
||||||
|
return ""
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def mb_link(self):
|
def mb_link(self):
|
||||||
return f"https://musicbrainz.org/artist/{self.musicbrainz_id}"
|
return f"https://musicbrainz.org/artist/{self.musicbrainz_id}"
|
||||||
@ -170,12 +178,9 @@ class Album(TimeStampedModel):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def primary_image_url(self) -> str:
|
def primary_image_url(self) -> str:
|
||||||
url = ""
|
if self.cover_image.url:
|
||||||
if self.thumbnail:
|
return self.cover_image.url
|
||||||
url = self.thumbnail.url
|
return ""
|
||||||
if not url and self.album_set.first().cover_image:
|
|
||||||
url = self.album_set.first().cover_image.url
|
|
||||||
return url
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def tracks(self):
|
def tracks(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user