Improve unzip speed
This commit is contained in:
@@ -214,7 +214,7 @@
|
||||
currentPage: page,
|
||||
totalPages: pages.length,
|
||||
totalCharCount: maxCharCount || 0,
|
||||
currentlineCount: lineCount,
|
||||
currentLineCount: lineCount,
|
||||
totalLineCount
|
||||
});
|
||||
}
|
||||
@@ -231,7 +231,7 @@
|
||||
currentPage: page,
|
||||
totalPages: pages.length,
|
||||
totalCharCount: maxCharCount || 0,
|
||||
currentlineCount: lineCount,
|
||||
currentLineCount: lineCount,
|
||||
totalLineCount
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { db } from '$lib/catalog/db';
|
||||
import type { Volume } from '$lib/types';
|
||||
import { showSnackbar } from '$lib/util/snackbar';
|
||||
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'
|
||||
|
||||
@@ -11,7 +11,7 @@ const imageTypes = ['image/jpeg', 'image/png', 'image/webp'];
|
||||
|
||||
|
||||
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 entries = await zipReader.getEntries();
|
||||
|
||||
@@ -40,7 +40,7 @@ type ExtaticPayload = {
|
||||
totalCharCount: number;
|
||||
currentPage: number;
|
||||
totalPages: number;
|
||||
currentlineCount: number;
|
||||
currentLineCount: number;
|
||||
totalLineCount: number;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user