From 224f73d053885dba004eaf950db29b9dbc784594 Mon Sep 17 00:00:00 2001 From: Shaun Tenner Date: Thu, 14 Dec 2023 11:36:11 +0900 Subject: [PATCH] Attempt to fix order issues --- src/lib/upload/index.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/lib/upload/index.ts b/src/lib/upload/index.ts index 831b8cc..df4194f 100644 --- a/src/lib/upload/index.ts +++ b/src/lib/upload/index.ts @@ -102,10 +102,22 @@ export async function scanFiles(item: FileSystemEntry, files: Promise = {}; const mangas: string[] = []; + const files = _files.sort((a, b) => { + if (a.name < b.name) { + return -1; + } + + if (a.name > b.name) { + return 1; + } + + return 0; + }); + for (const file of files) { const { ext, filename, path } = getDetails(file);