Ensure empty fields are filled

This commit is contained in:
Joshua Boniface 2023-04-03 04:55:46 -04:00
parent 2d82329e4f
commit f3b4119e1a
1 changed files with 4 additions and 1 deletions

5
c3dbdl
View File

@ -76,8 +76,11 @@ def buildDatabase(pages=None):
# Author (of chart) # Author (of chart)
song_entry["author"] = td.find('a').get_text().strip().replace('/', '+') song_entry["author"] = td.find('a').get_text().strip().replace('/', '+')
if song_entry and song_entry['title']: if song_entry and song_entry['author'] and song_entry['title']:
click.echo(f"Found song entry for {song_entry['artist']} - {song_entry['title']} by {song_entry['author']}") click.echo(f"Found song entry for {song_entry['artist']} - {song_entry['title']} by {song_entry['author']}")
for entry_type in ["artist", "album", "genre", "year", "length"]:
if not song_entry[entry_type]:
song_entry[entry_type] = "None"
found_songs.append(song_entry) found_songs.append(song_entry)
return found_songs return found_songs