Fix bug in audiodb scrape path

This commit is contained in:
2023-03-02 15:45:15 -05:00
parent fb6110c71d
commit 7dd7f369d8
2 changed files with 7 additions and 2 deletions

View File

@ -129,7 +129,9 @@ class Album(TimeStampedModel):
return self.artists.first()
def scrape_theaudiodb(self) -> None:
artist = self.primary_artist.name
artist = "Various Artists"
if self.primary_artist:
artist = self.primary_artist.name
album_data = lookup_album_from_tadb(self.name, artist)
if not album_data.get('theaudiodb_id'):
logger.info(f"No data for {self} found in TheAudioDB")