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
This commit is contained in:
ed 2025-09-13 21:10:10 +00:00
parent 14b7e5143f
commit 8f587627e1

View file

@ -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 != "*"