From d4377e49acf6eeafd1bd55dd0d2f1d284c307dd9 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Sun, 18 May 2025 23:19:17 -0400 Subject: [PATCH] [music] Fix getting album metadata --- vrobbler/apps/music/models.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vrobbler/apps/music/models.py b/vrobbler/apps/music/models.py index 6ceaf56..9903bc2 100644 --- a/vrobbler/apps/music/models.py +++ b/vrobbler/apps/music/models.py @@ -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}"