don't unwrap single folders in zip/tar downloads

This commit is contained in:
ed 2021-09-07 00:43:51 +02:00
parent 3a9d3b7b61
commit 9a146192b7

View file

@ -434,7 +434,11 @@ class VFS(object):
f2a = os.sep + "dir.txt" f2a = os.sep + "dir.txt"
f2b = "{0}.hist{0}".format(os.sep) f2b = "{0}.hist{0}".format(os.sep)
g = self.walk("", vrem, [], uname, [[True]], dots, scandir, False) # if multiselect: add all items to archive root
# if single folder: the folder itself is the top-level item
folder = "" if flt else (vrem.split("/")[-1] or "top")
g = self.walk(folder, vrem, [], uname, [[True]], dots, scandir, False)
for _, _, vpath, apath, files, rd, vd in g: for _, _, vpath, apath, files, rd, vd in g:
if flt: if flt:
files = [x for x in files if x[0] in flt] files = [x for x in files if x[0] in flt]