[music] Fix getting album metadata

This commit is contained in:
2025-05-18 23:19:17 -04:00
parent 9dc0a818ff
commit d4377e49ac

View File

@ -307,8 +307,15 @@ class Album(TimeStampedModel):
self.save(update_fields=["album_artist"])
def scrape_allmusic(self, force=False) -> None:
if not self.name:
logger.warning(
"Album without a name cannot be scraped",
extra={"album_id": self.id},
)
return
if not self.allmusic_id or force:
slug = get_allmusic_slug(self.name, self.album_artist.name)
slug = get_allmusic_slug(self.album_artist.name, self.name)
if not slug:
logger.info(
f"No allmsuic link for {self} by {self.album_artist}"