Fix issue where downloads folder is blank

This commit is contained in:
nathom 2021-07-28 22:28:37 -07:00
parent 1e6c138e54
commit ca67173162
2 changed files with 14 additions and 6 deletions

View file

@ -70,11 +70,19 @@ class Config:
def update(self):
"""Reset the config file except for credentials."""
self.reset()
temp = copy.deepcopy(self.defaults)
temp["qobuz"].update(self.file["qobuz"])
temp["tidal"].update(self.file["tidal"])
self.dump(temp)
del temp
# Save original credentials
qobuz_creds = self.file["qobuz"]
tidal_creds = self.file["tidal"]
# Reset and load config file
shutil.copy(self.default_config_path, self._path)
self.load()
# Set credentials and download directory, then save
self.file["qobuz"].update(qobuz_creds)
self.file["tidal"].update(tidal_creds)
self.file["downloads"]["folder"] = DOWNLOADS_DIR
self.save()
def save(self):
"""Save the config state to file."""