Fix jellyfin sync config merging

This commit is contained in:
Dymas
2026-05-26 11:42:21 +02:00
parent 4c430e1982
commit bf4fdc79f5
3 changed files with 44 additions and 5 deletions
+6 -3
View File
@@ -629,14 +629,17 @@ class Handler(BaseHTTPRequestHandler):
Handler.update_config(self, Handler.require_json_object(self, self.body_json()))
elif parsed.path == "/api/config/jellyfin/sync":
payload = Handler.require_json_object(self, self.body_json())
current = Handler._context(self).get_config_snapshot()
merged = dict(current)
merged.update(payload)
for key, label in (
("download_dir", "download directory"),
("jellyfin_tv_dir", "Jellyfin TV directory"),
("jellyfin_movie_dir", "Jellyfin movie directory"),
):
if str(payload.get(key) or "").strip():
Handler.validate_remote_path(self, payload[key], label)
self.json(Handler._context(self).run_jellyfin_sync(payload))
if str(merged.get(key) or "").strip():
Handler.validate_remote_path(self, merged[key], label)
self.json(Handler._context(self).run_jellyfin_sync(merged))
elif parsed.path == "/api/config/webhook/test":
payload = Handler.require_json_object(self, self.body_json())
validate_discord_webhook_url(payload.get("discord_webhook_url"))