Make editing easier

This commit is contained in:
Salt 2020-03-04 03:47:22 -06:00
parent fbc76ea62a
commit 33ba8e3845

View File

@ -143,13 +143,22 @@ class BadWitch:
try:
while True:
in_album = input('\tAlbum: ')
in_artist = input('\tArtist: ')
auto_artist = input('\tArtist (leave blank to assign per song): ')
auto_track = int(input('\tStarting track number (leave blank to assign per song): ') or -1)
if in_album not in lib.albums:
lib.albums[in_album] = {}
album = lib.albums[in_album]
try:
while True:
in_song = input('\t\tSong title: ')
if auto_artist is not '':
in_artist = auto_artist
else:
in_artist = input('\t\tArtist: ')
if auto_track is not -1:
in_track = auto_track
auto_track += 1
else:
in_track = input('\t\tTrack number: ')
in_source = input('\t\tSource URL: ')
# Only assign values if we gave them
@ -157,7 +166,7 @@ class BadWitch:
album[in_song] = {}
song = album[in_song]
if in_track is not '': song['track'] = int(in_track)
if in_artist is not '': song['artist'] = in_artist
if auto_artist is not '': song['artist'] = in_artist
if in_source is not '': song['source'] = in_source
# Bail if song is bad
for field in ['track', 'artist', 'source']: