From 2c26aecd878c185ce358f661d57612f91c21d4b1 Mon Sep 17 00:00:00 2001 From: ed Date: Wed, 24 Dec 2025 11:21:58 +0000 Subject: [PATCH] descript.ion for folders; closes #1127 --- copyparty/httpcli.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 42d033aa..bc2ec68b 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -7134,6 +7134,7 @@ class HttpCli(object): os.path.join(abspath, lnames["descript.ion"]) ): rem = [] + items = {x["name"].lower(): x for x in files + dirs} with open(os.path.join(abspath, lnames["descript.ion"]), "rb") as f: for bln in [x.strip() for x in f]: try: @@ -7146,12 +7147,9 @@ class HttpCli(object): fn = fn[1:] else: fn, desc = ln.split(" ", 1) - fe = next( - (x for x in files if x["name"].lower() == fn.lower()), None - ) - if fe: - fe["tags"]["descript.ion"] = desc - else: + try: + items[fn.lower()]["tags"]["descript.ion"] = desc + except: t = "
  • %s %s
  • " rem.append(t % (html_escape(fn), html_escape(desc))) except: