Ensure empty fields are filled
This commit is contained in:
parent
2d82329e4f
commit
f3b4119e1a
5
c3dbdl
5
c3dbdl
|
@ -76,8 +76,11 @@ def buildDatabase(pages=None):
|
|||
# Author (of chart)
|
||||
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']}")
|
||||
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)
|
||||
|
||||
return found_songs
|
||||
|
|
Loading…
Reference in New Issue