Improve unzip speed

This commit is contained in:
ZXY101
2024-03-10 04:54:29 +02:00
parent 282cad6558
commit 032d56a20e
3 changed files with 5 additions and 5 deletions

View File

@@ -214,7 +214,7 @@
currentPage: page, currentPage: page,
totalPages: pages.length, totalPages: pages.length,
totalCharCount: maxCharCount || 0, totalCharCount: maxCharCount || 0,
currentlineCount: lineCount, currentLineCount: lineCount,
totalLineCount totalLineCount
}); });
} }
@@ -231,7 +231,7 @@
currentPage: page, currentPage: page,
totalPages: pages.length, totalPages: pages.length,
totalCharCount: maxCharCount || 0, totalCharCount: maxCharCount || 0,
currentlineCount: lineCount, currentLineCount: lineCount,
totalLineCount totalLineCount
}); });
} }

View File

@@ -2,7 +2,7 @@ import { db } from '$lib/catalog/db';
import type { Volume } from '$lib/types'; import type { Volume } from '$lib/types';
import { showSnackbar } from '$lib/util/snackbar'; import { showSnackbar } from '$lib/util/snackbar';
import { requestPersistentStorage } from '$lib/util/upload'; import { requestPersistentStorage } from '$lib/util/upload';
import { BlobReader, ZipReader, BlobWriter, getMimeType } from '@zip.js/zip.js'; import { ZipReader, BlobWriter, getMimeType, Uint8ArrayReader } from '@zip.js/zip.js';
export * from './web-import' export * from './web-import'
@@ -11,7 +11,7 @@ const imageTypes = ['image/jpeg', 'image/png', 'image/webp'];
export async function unzipManga(file: File) { export async function unzipManga(file: File) {
const zipFileReader = new BlobReader(file); const zipFileReader = new Uint8ArrayReader(new Uint8Array(await file.arrayBuffer()));
const zipReader = new ZipReader(zipFileReader); const zipReader = new ZipReader(zipFileReader);
const entries = await zipReader.getEntries(); const entries = await zipReader.getEntries();

View File

@@ -40,7 +40,7 @@ type ExtaticPayload = {
totalCharCount: number; totalCharCount: number;
currentPage: number; currentPage: number;
totalPages: number; totalPages: number;
currentlineCount: number; currentLineCount: number;
totalLineCount: number; totalLineCount: number;
} }