show logues in write-only folders

This commit is contained in:
ed 2021-05-12 21:20:59 +02:00
parent 57e1c53cbb
commit c7d9cbb11f
2 changed files with 14 additions and 12 deletions

View file

@ -136,11 +136,13 @@ summary: it works! you can use it! (but technically not even close to beta)
## hotkeys
the browser has the following hotkeys
* `I/K` prev/next folder
* `P` parent folder
* when playing audio:
* `0..9` jump to 10%..90%
* `U/O` skip 10sec back/forward
* `J/L` prev/next song
* `I/K` prev/next folder
* `P` parent folder
* `J` also starts playing the folder
## tree-mode
@ -399,7 +401,7 @@ these are standalone programs and will never be imported / evaluated by copypart
# sfx
currently there are two self-contained binaries:
currently there are two self-contained "binaries":
* [copyparty-sfx.py](https://github.com/9001/copyparty/releases/latest/download/copyparty-sfx.py) -- pure python, works everywhere
* [copyparty-sfx.sh](https://github.com/9001/copyparty/releases/latest/download/copyparty-sfx.sh) -- smaller, but only for linux and macos

View file

@ -1360,6 +1360,13 @@ class HttpCli(object):
if "b" in self.uparam:
tpl = "browser2"
logues = ["", ""]
for n, fn in enumerate([".prologue.html", ".epilogue.html"]):
fn = os.path.join(abspath, fn)
if os.path.exists(fsenc(fn)):
with open(fsenc(fn), "rb") as f:
logues[n] = f.read().decode("utf-8")
j2a = {
"vdir": quotep(self.vpath),
"vpnodes": vpnodes,
@ -1373,7 +1380,7 @@ class HttpCli(object):
"have_zip": (not self.args.no_zip),
"have_b_u": (self.writable and self.uparam.get("b") == "u"),
"url_suf": url_suf,
"logues": ["", ""],
"logues": logues,
"title": html_escape(self.vpath, crlf=True),
"srv_info": srv_info,
}
@ -1526,13 +1533,6 @@ class HttpCli(object):
for f in dirs:
f["tags"] = {}
logues = ["", ""]
for n, fn in enumerate([".prologue.html", ".epilogue.html"]):
fn = os.path.join(abspath, fn)
if os.path.exists(fsenc(fn)):
with open(fsenc(fn), "rb") as f:
logues[n] = f.read().decode("utf-8")
if is_ls:
[x.pop(k) for k in ["name", "dt"] for y in [dirs, files] for x in y]
ret = {