Improve date detection
This commit is contained in:
parent
cb28ce9bb0
commit
37c2081627
@ -335,8 +335,10 @@ class BadWitch:
|
||||
album = entries[i]['album']
|
||||
# Sometimes this just comes back None
|
||||
if 'release_date' in entries[i] and entries[i]['release_date'] is not None and 'release_date' not in metadata:
|
||||
print('Detected release date ' + entries[i]['release_date'])
|
||||
metadata['release_date'] = entries[i]['release_date']
|
||||
metadata['release_date'] = str(entries[i]['release_date'])
|
||||
# Format up into a more proper date
|
||||
metadata['release_date'] = metadata['release_date'][:4] + '-' + metadata['release_date'][4:6] + '-' + metadata['release_date'][6:]
|
||||
print('Detected release date ' + metadata['release_date'])
|
||||
# If YouTube's song tags didn't work, just grab metadata from the playlist
|
||||
if album == '':
|
||||
album = result['title']
|
||||
|
Loading…
Reference in New Issue
Block a user