From c06fac0f55e42b95673795aff6ca12664c5d9ece Mon Sep 17 00:00:00 2001 From: Vxrtrauter Date: Fri, 10 Oct 2025 14:10:11 +0200 Subject: [PATCH] fixed settings write bug and add a comment-style title --- core/utils/settings.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/utils/settings.py b/core/utils/settings.py index 2235b20..0544f5f 100644 --- a/core/utils/settings.py +++ b/core/utils/settings.py @@ -14,6 +14,10 @@ def restart_aria2c(): atexit.register(main.kill_aria2server) def save_settings(thread_count, close, apiurl): + + state.aria2_threads = thread_count + state.api_url = apiurl + if platform.system() == "Windows": config_dir = os.environ.get("APPDATA", os.path.expanduser("~\\AppData\\Roaming")) else: @@ -22,11 +26,11 @@ def save_settings(thread_count, close, apiurl): os.makedirs(settings_path, exist_ok=True) with open(os.path.join(settings_path, "config.yml"), 'w') as f: + f.write("# SoftwareManager Config file\n\n") f.write(f"aria2_threads: {state.aria2_threads}\n") f.write(f"api_url: {state.api_url}\n") - state.aria2_threads = thread_count - state.api_url = apiurl + restart_aria2c() close()