fix: download all proper file extension

if downloading all files as a .zip, if the result is a .zip (e.g. converting to docx) it would have the "target" file extension rather than the result. final file seems "broken", but has the wrong extension (.docx instead of .zip)
This commit is contained in:
Maya 2025-11-20 07:42:24 +03:00
parent 3cd1989ecd
commit 990027d61b
No known key found for this signature in database
1 changed files with 4 additions and 2 deletions

View File

@ -350,13 +350,15 @@ class Files {
for (let i = 0; i < files.files.length; i++) {
const file = files.files[i];
const result = file.result;
let to = file.to;
if (!to.startsWith(".")) to = `.${to}`;
if (!result) {
error(["files"], "No result found");
continue;
}
let to = result.to;
if (!to.startsWith(".")) to = `.${to}`;
dlFiles.push({
name: file.file.name.replace(/\.[^/.]+$/, "") + to,
lastModified: Date.now(),