This commit is contained in:
Lars Noack 2022-10-19 15:41:54 +02:00
parent a804faa144
commit 892e5e5cc4

View File

@ -58,7 +58,7 @@ dict_keys(
'musicip_puid', 'musicip_puid',
'musicip_fingerprint', 'musicip_fingerprint',
'musicbrainz_albumstatus', 'musicbrainz_albumstatus',
'musicbrainz_albumtype', 'musicbrainz_albumtype', <----------
'releasecountry', 'releasecountry',
'musicbrainz_discid', 'musicbrainz_discid',
'asin', 'asin',
@ -110,6 +110,13 @@ class Download:
def write_metadata(self, row, file): def write_metadata(self, row, file):
audiofile = EasyID3(file) audiofile = EasyID3(file)
valid_keys = list(EasyID3.valid_keys.keys())
for key in list(row):
if key in valid_keys and row[key] is not None:
audiofile[key] = row[key]
"""
audiofile["artist"] = row['artist'] audiofile["artist"] = row['artist']
audiofile["albumartist"] = row['album_artist'] audiofile["albumartist"] = row['album_artist']
audiofile["date"] = str(row['year']) audiofile["date"] = str(row['year'])
@ -117,6 +124,7 @@ class Download:
audiofile["title"] = row['title'] audiofile["title"] = row['title']
audiofile["album"] = row['album'] audiofile["album"] = row['album']
audiofile["tracknumber"] = str(row['track']) audiofile["tracknumber"] = str(row['track'])
"""
audiofile.save() audiofile.save()