Add generalized cover field for scobblable things
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user