From 52c42b83e4002c91232ffe82affe55d683fa7212 Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 28 Jun 2026 15:52:46 +0000 Subject: [PATCH] optimize md-edit --- copyparty/authsrv.py | 9 ++++++++- copyparty/cfg.py | 1 + copyparty/httpcli.py | 4 +--- copyparty/web/md.html | 8 +------- copyparty/web/md2.js | 4 ++-- copyparty/web/mde.html | 8 +------- 6 files changed, 14 insertions(+), 20 deletions(-) diff --git a/copyparty/authsrv.py b/copyparty/authsrv.py index 10447c72..069ace85 100644 --- a/copyparty/authsrv.py +++ b/copyparty/authsrv.py @@ -443,6 +443,7 @@ class VFS(object): self.adot: dict[str, list[str]] = {} self.js_ls = {} self.js_htm = "" + self.md_htm = "" self.all_vols: dict[str, VFS] = {} # flattened recursive self.all_nodes: dict[str, VFS] = {} # also jumpvols/shares self.all_fvols: dict[str, VFS] = {} # volumes which are files @@ -3193,7 +3194,7 @@ class AuthSrv(object): db.close() self.js_ls = {} - self.js_htm = {} + self.js_htm = "" for vp, vn in self.vfs.all_nodes.items(): if enshare and vp.startswith(shrs): continue # propagates later in this func @@ -3285,7 +3286,13 @@ class AuthSrv(object): zs2 = getattr(self.args, zs, "") if zs2: js_htm[zs] = zs2 + + zs = "have_emp md_no_br" + md_htm = {x:js_htm[x] for x in zs.split(" ")} + md_htm["modpoll_freq"] = self.args.mcr + vn.js_htm = json_hesc(json.dumps(js_htm)) + vn.md_htm = json_hesc(json.dumps(md_htm)) vols = list(vfs.all_nodes.values()) if enshare: diff --git a/copyparty/cfg.py b/copyparty/cfg.py index d4c163bb..980e5a36 100644 --- a/copyparty/cfg.py +++ b/copyparty/cfg.py @@ -137,6 +137,7 @@ def vf_vmap() -> dict[str, str]: "put_ck", "put_name", "readmes", + "rotf_tz", "mv_retry", "rm_retry", "rss_sort", diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 308f8a34..521b785f 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -5390,11 +5390,9 @@ class HttpCli(object): "lastmod": int(ts_md * 1000), "lang": self.cookies.get("cplng") or self.args.lang, "favico": self.args.favico, - "have_emp": int(self.args.emp), - "md_no_br": int(vn.flags.get("md_no_br") or 0), - "md_chk_rate": self.args.mcr, "md": boundary, "arg_base": arg_base, + "cgv1": self.vn.md_htm, } if self.args.js_other and "js" not in targs: diff --git a/copyparty/web/md.html b/copyparty/web/md.html index e2d1a9e6..65deec1e 100644 --- a/copyparty/web/md.html +++ b/copyparty/web/md.html @@ -134,16 +134,10 @@ write markdown (most html is 🙆 too)