Add watchlist filesystem reconciliation

This commit is contained in:
Codex
2026-07-21 09:41:24 +02:00
parent ef2df14aab
commit 0e40c9bda9
7 changed files with 332 additions and 4 deletions
+9
View File
@@ -66,6 +66,7 @@ class HandlerContext:
http_error: object
index_html: str
queue_html: str
reconcile_watchlist_downloaded_files: object
remove_from_watchlist: object
run_jellyfin_sync: object
runtime_state: object
@@ -787,6 +788,14 @@ class Handler(BaseHTTPRequestHandler):
if str(merged.get(key) or "").strip():
Handler.validate_remote_path(self, merged[key], label)
self.json(Handler._context(self).start_jellyfin_sync(merged), HTTPStatus.ACCEPTED)
elif parsed.path == "/api/config/watchlist/reconcile-downloads":
payload = Handler.require_json_object(self, self.body_json())
current = Handler._context(self).get_config_snapshot()
merged = dict(current)
merged.update(payload)
if str(merged.get("download_dir") or "").strip():
Handler.validate_remote_path(self, merged["download_dir"], "download directory")
self.json(Handler._context(self).reconcile_watchlist_downloaded_files(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"))