Fix order for unzipped manga
This commit is contained in:
@@ -17,7 +17,19 @@ export async function unzipManga(file: File) {
|
|||||||
const entries = await zipReader.getEntries();
|
const entries = await zipReader.getEntries();
|
||||||
const unzippedFiles: Record<string, File> = {};
|
const unzippedFiles: Record<string, File> = {};
|
||||||
|
|
||||||
for (const entry of entries) {
|
const sortedEntries = entries.sort((a, b) => {
|
||||||
|
if (a.filename < b.filename) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (a.filename > b.filename) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
})
|
||||||
|
|
||||||
|
for (const entry of sortedEntries) {
|
||||||
const mime = getMimeType(entry.filename);
|
const mime = getMimeType(entry.filename);
|
||||||
if (imageTypes.includes(mime)) {
|
if (imageTypes.includes(mime)) {
|
||||||
const blob = await entry.getData?.(new BlobWriter(mime));
|
const blob = await entry.getData?.(new BlobWriter(mime));
|
||||||
|
|||||||
Reference in New Issue
Block a user