From 33ba8e3845feff6a6d7de6dc63d7c09ce367147e Mon Sep 17 00:00:00 2001 From: Salt Date: Wed, 4 Mar 2020 03:47:22 -0600 Subject: [PATCH] Make editing easier --- badwitch.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/badwitch.py b/badwitch.py index 23b60a5..2f39d8c 100755 --- a/badwitch.py +++ b/badwitch.py @@ -143,21 +143,30 @@ 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: ') - in_track = input('\t\tTrack number: ') + 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 if in_song not in album: 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']: