Remove music metadata words containing colon

main
Bob Mottram 2022-05-20 17:16:58 +01:00
parent 7907d79eaa
commit 240e7219cd
1 changed files with 7 additions and 0 deletions

View File

@ -190,6 +190,13 @@ def get_music_metadata(filename: str) -> {}:
field_value = line.split(field + ' = ')[1]
if '>' in field_value:
field_value = field_value.split('>')[0].strip()
if ':' in field_value and ' ' in field_value:
words = field_value.split(' ')
new_value = ''
for wrd in words:
if ':' not in wrd:
new_value += wrd + ' '
field_value = new_value.strip()
music_metadata[field.lower()] = field_value
return music_metadata