From 3f8d4d5ae9b945ad399f0015542c93402b090498 Mon Sep 17 00:00:00 2001 From: RemixDev Date: Fri, 14 Aug 2020 18:14:08 +0200 Subject: [PATCH] Moved local outside of settings --- deemix/__main__.py | 5 ++++- deemix/app/settings.py | 7 ++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/deemix/__main__.py b/deemix/__main__.py index ae5ce1b..029cecd 100644 --- a/deemix/__main__.py +++ b/deemix/__main__.py @@ -11,7 +11,10 @@ from os.path import isfile @click.option('-l', '--local', is_flag=True, help='Downloads in a local folder insted of using the default') @click.argument('url', nargs=-1, required=True) def download(bitrate, local, url): - settings = initSettings(local) + settings = initSettings() + if local: + settings['downloadLocation'] = randomString(12) + click.echo("Using a local download folder: "+settings['downloadLocation']) app.login() url = list(url) if isfile(url[0]): diff --git a/deemix/app/settings.py b/deemix/app/settings.py index eff73e5..e55e9b7 100644 --- a/deemix/app/settings.py +++ b/deemix/app/settings.py @@ -18,7 +18,7 @@ settings = {} defaultSettings = {} configDir = "" -def initSettings(localFolder = False, configFolder = None): +def initSettings(configFolder = None): global settings global defaultSettings global configDir @@ -37,10 +37,7 @@ def initSettings(localFolder = False, configFolder = None): settings = json.load(configFile) settingsCheck() - if localFolder: - settings['downloadLocation'] = randomString(12) - logger.info("Using a local download folder: "+settings['downloadLocation']) - elif settings['downloadLocation'] == "": + if settings['downloadLocation'] == "": settings['downloadLocation'] = path.join(localpaths.getHomeFolder(), 'deemix Music') saveSettings(settings) makedirs(settings['downloadLocation'], exist_ok=True)