From 322c49122c870cd5badec223ea652461a241187c Mon Sep 17 00:00:00 2001 From: FunLay123 Date: Mon, 20 Jul 2026 07:51:28 +0700 Subject: [PATCH] fix: update download_settings host changes without re-saving the main host When a host is used as another host's xhttp download_settings, editing that host alone did not update the main host's cached data. Now, saving a host also refreshes every host that points to it as their download_settings. --- app/operation/host.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/operation/host.py b/app/operation/host.py index ca7e59b7c..459b0e153 100644 --- a/app/operation/host.py +++ b/app/operation/host.py @@ -95,7 +95,13 @@ async def modify_host( host = BaseHost.model_validate(db_host) asyncio.create_task(notification.modify_host(host, admin.username)) - await host_manager.add_host(db, db_host) + db_hosts = await get_hosts(db=db) + dependents = [ + h + for h in db_hosts + if ((h.transport_settings or {}).get("xhttp_settings") or {}).get("download_settings") == host_id + ] + await host_manager.add_hosts(db, [db_host, *dependents]) return host