minor reformatting, configurable output dir

This commit is contained in:
Lynne Megido 2020-10-16 16:59:39 +10:00
parent 0ff526b5ca
commit 8cc483bfa8
Signed by: lynnesbian
GPG key ID: F0A184B5213D9F90

View file

@ -33,6 +33,7 @@ except:
parser = argparse.ArgumentParser(description = "BandCamp Automatic Organiser. Extracts the given zip file downloaded from Bandcamp and organises it.") parser = argparse.ArgumentParser(description = "BandCamp Automatic Organiser. Extracts the given zip file downloaded from Bandcamp and organises it.")
parser.add_argument('zip', help='The zip file to use') parser.add_argument('zip', help='The zip file to use')
# KEEP THESE IN ALPHABETICAL ORDER! # KEEP THESE IN ALPHABETICAL ORDER!
parser.add_argument('-d', '--destination', dest='destination', default='/home/lynne/Music/Music/', help="The directory to organise the music into. Default: /home/lynne/Music/Music/")
parser.add_argument('-q', '--quiet', dest='quiet', action='store_true', help='Disable non-error output') parser.add_argument('-q', '--quiet', dest='quiet', action='store_true', help='Disable non-error output')
parser.add_argument('-t', '--threshold', dest='threshold', nargs=1, default=300, help="Maximum acceptable cover art file size in kilobytes. Default: 300") parser.add_argument('-t', '--threshold', dest='threshold', nargs=1, default=300, help="Maximum acceptable cover art file size in kilobytes. Default: 300")
@ -154,7 +155,7 @@ if choice == "Custom...":
# print("Setting artist to {0}".format(choice)) # print("Setting artist to {0}".format(choice))
artist = choice artist = choice
mPath = "/home/lynne/Music/Music/{}/{}".format(artist, album) #todo: don't hardcode this mPath = "{}/{}/{}".format(args.destination, artist, album)
subprocess.check_output(["mkdir", "-p", mPath]) subprocess.check_output(["mkdir", "-p", mPath])
for root, dirs, filez in os.walk(tmp): for root, dirs, filez in os.walk(tmp):