Attempt to fix order issues

This commit is contained in:
Shaun Tenner
2023-12-14 11:36:11 +09:00
parent a2f59640af
commit 224f73d053

View File

@@ -102,10 +102,22 @@ export async function scanFiles(item: FileSystemEntry, files: Promise<File | und
} }
} }
export async function processFiles(files: File[]) { export async function processFiles(_files: File[]) {
const volumes: Record<string, Volume> = {}; const volumes: Record<string, Volume> = {};
const mangas: string[] = []; 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) { for (const file of files) {
const { ext, filename, path } = getDetails(file); const { ext, filename, path } = getDetails(file);