tweaks
This commit is contained in:
parent
559a7eece4
commit
5b2cffbd00
1 changed files with 4 additions and 3 deletions
|
|
@ -55,7 +55,7 @@ async function downloadApplicantFilesWithProgress(applicantDetails, token, onPro
|
|||
throw `Failed to download file ${afile.file_id} for applicant ${applicantDetails.id}`
|
||||
}
|
||||
|
||||
afile.bytes = await response.bytes()
|
||||
afile.bytes = new Uint8Array(await response.arrayBuffer())
|
||||
completedDownloads += 1
|
||||
downloadedBytes += afile.bytes.length
|
||||
onProgress({ downloaded: completedDownloads, total: files.length, bytes: downloadedBytes })
|
||||
|
|
@ -128,7 +128,7 @@ async function getApplicants() {
|
|||
|
||||
function sanitizeZipPathSegment(value, fallback = "unnamed") {
|
||||
const sanitized = String(value ?? "")
|
||||
.replace(/[\/\\:*?"<>|]/g, "_")
|
||||
.replace(/[\/\\:*?"<>| ]/g, "_")
|
||||
.trim()
|
||||
|
||||
return sanitized === "" ? fallback : sanitized
|
||||
|
|
@ -291,7 +291,7 @@ async function createZipBlob(archiveEntries) {
|
|||
console.log(archiveEntries)
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
fflate.zip(archiveEntries, { level: 0, consume: true }, (error, data) => {
|
||||
fflate.zip(archiveEntries, { mem: 9, level: 0, consume: true }, (error, data) => {
|
||||
if (error != null) {
|
||||
reject(error)
|
||||
return
|
||||
|
|
@ -527,6 +527,7 @@ function rip(event) {
|
|||
archiveEntries["fflate.min.js"] = viewerFflateSource
|
||||
|
||||
console.log("Generating zip archive...")
|
||||
|
||||
createZipBlob(archiveEntries)
|
||||
.then((zipBlob) => {
|
||||
console.log("Zip archive is ready.")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue