fix: realtime subfolder discovery, count updates, and deep level scan indicator

This commit is contained in:
2026-10-08 19:09:27 +07:00
parent bfda4b4b9e
commit 779ae14a21
4 changed files with 39 additions and 6 deletions
+2
View File
@@ -798,12 +798,14 @@ export async function scanFolder(
const relNorm = rel.replace(/\\/g, '/');
const cut = relNorm.lastIndexOf('/');
counts[normRoot] = (counts[normRoot] ?? 0) + n;
counts[normRoot.toLowerCase()] = counts[normRoot];
let path = '';
for (const part of (cut < 0 ? '' : relNorm.slice(0, cut)).split('/')) {
if (!part) continue;
path = path ? `${path}/${part}` : part;
const key = `${normRoot}/${path}`;
counts[key] = (counts[key] ?? 0) + n;
counts[key.toLowerCase()] = counts[key];
}
};
for (const id of known.keys()) count(id.startsWith(`${normRoot}/`) ? id.slice(normRoot.length + 1) : id);