Let's also thumbnail the now playing widget

This commit is contained in:
2023-03-28 15:24:04 -04:00
parent c39430e987
commit 76cc1f7b1c
8 changed files with 36 additions and 29 deletions

View File

@ -1,5 +1,6 @@
import logging
from datetime import timedelta
from typing import Optional
from uuid import uuid4
import requests
@ -84,11 +85,11 @@ class Book(LongPlayScrobblableMixin):
return f" by {self.author}"
@property
def primary_image_url(self) -> str:
url = ""
def primary_image(self) -> Optional["ImageField"]:
img = None
if self.cover:
url = self.cover.url
return url
img = self.cover
return img
def get_start_url(self):
return reverse("scrobbles:start", kwargs={"uuid": self.uuid})