diff --git a/badwitch.py b/badwitch.py index ab479d8..605b88a 100755 --- a/badwitch.py +++ b/badwitch.py @@ -304,6 +304,8 @@ class BadWitch: return def playlist(self, lib): + print('Bad Witch playlist importer') + print('Loaded library ' + lib.file) in_playlist = input('YouTube Playlist URL: ') playlist = {} metadata = {} @@ -331,6 +333,7 @@ class BadWitch: if 'album' in item and album == '': print('Detected album title ' + entries[i]['album']) album = entries[i]['album'] + # Sometimes this just comes back None if 'release_date' in item and 'release_date' not in metadata and entries[i]['release_date'] is not None: print('Detected release date ' + entries[i]['release_date']) metadata['release_date'] = entries[i]['release_date'] @@ -358,13 +361,12 @@ class BadWitch: 'source': songcontent['source'] } lib.albums[album] = playlistalbum - lib.validate() - lib.save() - print('Successfully added "' + album + '" by ' + artist) + print(f'Successfully added "{album}" by {artist}') for song, songcontent in lib.albums[album].items(): if song == 'meta': continue print(str(songcontent['track']) + ': ' + song + ' (' + songcontent['source'] + ')') + lib.save() def prompt(self, lib): print('Bad Witch interactive library editor')