Better validation exceptions

This commit is contained in:
Salt 2020-03-04 03:49:37 -06:00
parent 33ba8e3845
commit 64af929cf1

View File

@ -47,11 +47,9 @@ class Library:
try:
for album, albumcontent in self.albums.items():
for song, songcontent in albumcontent.items():
if songcontent['artist'] is None:
raise Exception
except:
logging.warn('Library not valid')
raise Exception('Library not valid')
for field in ['track', 'artist', 'source']:
if field not in songcontent:
raise Exception('Song is missing required field', song, field)
# Download library
def download(self, targetalbum=None):