From 8f587627e16cb14efa0c20ad77e18728792e4186 Mon Sep 17 00:00:00 2001 From: ed Date: Sat, 13 Sep 2025 21:10:10 +0000 Subject: [PATCH] download-as-zip: better names for selections; previously, the first selected file became the name of the zip now, the name will be "sel-foldername", similar to when the whole folder is downloaded, but with a prefix to indicate it's a subset --- copyparty/httpcli.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 2f36c04c..2b53f00d 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -4731,11 +4731,9 @@ class HttpCli(object): packer = StreamZip ext = "zip" - fn = items[0] if items and items[0] else self.vpath - if fn: - fn = fn.rstrip("/").split("/")[-1] - else: - fn = self.host.split(":")[0] + fn = self.vpath.split("/")[-1] or self.host.split(":")[0] + if items: + fn = "sel-" + fn if vn.flags.get("zipmax") and not ( vn.flags.get("zipmaxu") and self.uname != "*"