diff --git a/cista-front/src/components/HeaderSelected.vue b/cista-front/src/components/HeaderSelected.vue index 2602b64..cdfd0d7 100644 --- a/cista-front/src/components/HeaderSelected.vue +++ b/cista-front/src/components/HeaderSelected.vue @@ -138,7 +138,8 @@ const download = async () => { } } // Otherwise, zip and download - linkdl(`/zip/${Array.from(sel.keys).join('+')}/download.zip`) + const name = sel.keys.length === 1 ? sel.docs[sel.keys[0]].name : 'download' + linkdl(`/zip/${Array.from(sel.keys).join('+')}/${name}.zip`) documentStore.selected.clear() } diff --git a/cista/app.py b/cista/app.py index b621276..63f7f6f 100644 --- a/cista/app.py +++ b/cista/app.py @@ -190,7 +190,7 @@ async def zip_download(req, keys, zipfile, ext): rel = None if relpar or attr.key in wanted: rel = [*relpar, name] if relpar else [name] - wanted.remove(attr.key) + wanted.discard(attr.key) if isinstance(attr, DirEntry): q.append((loc, rel, attr.dir)) elif rel: