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

@ -29,6 +29,7 @@ class Podcast(TimeStampedModel):
)
active = models.BooleanField(default=True)
url = models.URLField(**BNULL)
cover = models.ImageField(upload_to="pdocasts/covers/", **BNULL)
def __str__(self):
return f"{self.name}"
@ -53,6 +54,13 @@ class Episode(ScrobblableMixin):
def info_link(self):
return ""
@property
def primary_image_url(self) -> str:
url = ""
if self.podcast.cover:
url = self.podcast.cover.url
return url
@classmethod
def find_or_create(
cls, podcast_dict: Dict, producer_dict: Dict, episode_dict: Dict