Add generalized cover field for scobblable things

This commit is contained in:
2023-03-22 18:27:04 -04:00
parent bc59ff66eb
commit 15be4e0068
11 changed files with 680 additions and 13 deletions

View File

@ -92,6 +92,15 @@ class VideoGame(LongPlayScrobblableMixin):
def subtitle(self):
return f" On {self.platforms.first()}"
@property
def primary_image_url(self) -> str:
url = ""
if self.cover:
url = self.cover.url
if self.hltb_cover:
url = self.hltb_cover.url
return url
def get_absolute_url(self):
return reverse(
"videogames:videogame_detail", kwargs={"slug": self.uuid}