Moved local outside of settings

This commit is contained in:
RemixDev 2020-08-14 18:14:08 +02:00
parent 42842b07b8
commit 3f8d4d5ae9
2 changed files with 6 additions and 6 deletions

View File

@ -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]):

View File

@ -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)