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}`
|
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
|
completedDownloads += 1
|
||||||
downloadedBytes += afile.bytes.length
|
downloadedBytes += afile.bytes.length
|
||||||
onProgress({ downloaded: completedDownloads, total: files.length, bytes: downloadedBytes })
|
onProgress({ downloaded: completedDownloads, total: files.length, bytes: downloadedBytes })
|
||||||
|
|
@ -128,7 +128,7 @@ async function getApplicants() {
|
||||||
|
|
||||||
function sanitizeZipPathSegment(value, fallback = "unnamed") {
|
function sanitizeZipPathSegment(value, fallback = "unnamed") {
|
||||||
const sanitized = String(value ?? "")
|
const sanitized = String(value ?? "")
|
||||||
.replace(/[\/\\:*?"<>|]/g, "_")
|
.replace(/[\/\\:*?"<>| ]/g, "_")
|
||||||
.trim()
|
.trim()
|
||||||
|
|
||||||
return sanitized === "" ? fallback : sanitized
|
return sanitized === "" ? fallback : sanitized
|
||||||
|
|
@ -291,7 +291,7 @@ async function createZipBlob(archiveEntries) {
|
||||||
console.log(archiveEntries)
|
console.log(archiveEntries)
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
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) {
|
if (error != null) {
|
||||||
reject(error)
|
reject(error)
|
||||||
return
|
return
|
||||||
|
|
@ -527,6 +527,7 @@ function rip(event) {
|
||||||
archiveEntries["fflate.min.js"] = viewerFflateSource
|
archiveEntries["fflate.min.js"] = viewerFflateSource
|
||||||
|
|
||||||
console.log("Generating zip archive...")
|
console.log("Generating zip archive...")
|
||||||
|
|
||||||
createZipBlob(archiveEntries)
|
createZipBlob(archiveEntries)
|
||||||
.then((zipBlob) => {
|
.then((zipBlob) => {
|
||||||
console.log("Zip archive is ready.")
|
console.log("Zip archive is ready.")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue