Refine remote config and path browsing
This commit is contained in:
+6
-1
@@ -133,10 +133,12 @@ def browse_filesystem(path_value="", mode="dir", allowed_roots=None):
|
||||
parent_path = str(resolved.parent if resolved.parent != resolved else resolved)
|
||||
if allowed_roots and not path_is_within_roots(parent_path, allowed_roots):
|
||||
parent_path = str(resolved)
|
||||
root_paths = [str(Path(root)) for root in (allowed_roots or [])]
|
||||
return {
|
||||
"path": str(resolved),
|
||||
"parent_path": parent_path,
|
||||
"home_path": str(allowed_roots[0] if allowed_roots else Path.home()),
|
||||
"root_paths": root_paths,
|
||||
"mode": browse_mode,
|
||||
"entries": entries,
|
||||
}
|
||||
@@ -731,7 +733,10 @@ class Handler(BaseHTTPRequestHandler):
|
||||
|
||||
def update_config(self, payload):
|
||||
payload = Handler.require_json_object(self, payload)
|
||||
config = normalize_config(payload)
|
||||
current = Handler._context(self).get_config_snapshot()
|
||||
merged = dict(current)
|
||||
merged.update(payload)
|
||||
config = normalize_config(merged)
|
||||
for key, label in (
|
||||
("download_dir", "download directory"),
|
||||
("jellyfin_tv_dir", "Jellyfin TV directory"),
|
||||
|
||||
Reference in New Issue
Block a user