Slugify filenames when metadata found on Spotify too (#265)

This commit is contained in:
Ritiek Malhotra
2018-05-20 15:18:45 +05:30
committed by GitHub
parent c885c9eff0
commit 9b181df77e
3 changed files with 18 additions and 7 deletions

View File

@@ -67,9 +67,10 @@ def generate_metadata(raw_song):
except lyricwikia.LyricsNotFound:
meta_tags['lyrics'] = None
# fix clutter
# Some sugar
meta_tags['year'], *_ = meta_tags['release_date'].split('-')
meta_tags['duration'] = meta_tags['duration_ms'] / 1000.0
# Remove unwanted parameters
del meta_tags['duration_ms']
del meta_tags['available_markets']
del meta_tags['album']['available_markets']