Improve unzip speed
This commit is contained in:
@@ -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
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user