From cb2a453b5f6b5c874a99ae28b6f7837863620e10 Mon Sep 17 00:00:00 2001 From: yuming Date: Sun, 26 Apr 2026 10:26:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=9D=E5=AD=98=E5=B8=B8=E8=A7=84?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=97=B6=E5=90=8C=E6=AD=A5=E5=86=85=E5=AD=98?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=EF=BC=8C=E9=81=BF=E5=85=8D=E9=87=8D=E5=90=AF?= =?UTF-8?q?=E5=89=8D=E8=A2=AB=E6=97=A7=E5=80=BC=E8=A6=86=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/web.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/module/web.py b/module/web.py index f59e929..95e4eb5 100644 --- a/module/web.py +++ b/module/web.py @@ -1239,7 +1239,19 @@ def api_settings_general(): with open(CONFIG_FILE_PATH, "w", encoding="utf-8") as f: yaml_inst.dump(config, f) + # 同步更新内存中的配置,避免重启前 update_config() 把新值覆盖回旧值 if _app: + if "max_download_task" in data: + _app.config["max_download_task"] = config["max_download_task"] + if "log_level" in data: + _app.config["log_level"] = config["log_level"] + if "save_path" in data and data.get("save_path"): + _app.config["save_path"] = config["save_path"] + if "proxy" in data: + if "proxy" in config: + _app.config["proxy"] = dict(config["proxy"]) + else: + _app.config.pop("proxy", None) _app.restart_program = True return jsonify({"success": True})