From 1a718a74d94ae7478f71482bd756419de0904d37 Mon Sep 17 00:00:00 2001 From: 3dtours Date: Thu, 15 Oct 2026 16:22:15 +0700 Subject: [PATCH] fix(library): a roll picked at a drive root counts its frames under one spelling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The picker hands a whole drive over named `\`, which `normPath` folds to the empty root, and a row of that roll was keyed `Roll` where the reading files its counts, its walked folders and its frames under `/Roll` — one folder under two names. Every number beside a subfolder of a picked drive read nought, and the spinner of a reading stood on the roll's own row and nowhere it was reading. The row key is the roll's own spelling again, and so is the path `relOf` hands back for a row under it: a reading kept to one folder of a drive root asks for `/Roll`, and `sub` counted from the old `Roll/` merged nothing. Both are the spelling the check at the foot of `scripts/tree-scan-check.mjs` asks for, and it is green again. A bounded reading also measured itself against `\/Roll` spelled from the raw name, which no id is filed under: `held` stood at nought and the line read the catalogue's whole roll as the ground it was climbing from. It is built from `normPath` of both, the way an id is. --- docker/frontend/src/Library.tsx | 3 +-- docker/frontend/src/engine/library.ts | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docker/frontend/src/Library.tsx b/docker/frontend/src/Library.tsx index dcf9687..5607537 100644 --- a/docker/frontend/src/Library.tsx +++ b/docker/frontend/src/Library.tsx @@ -1586,7 +1586,6 @@ function Catalogue({ admin, user }: { admin: boolean; user: User | null }) { const normRoot = normPath(rootName); const normKey = normPath(key); if (normKey === normRoot) return ''; - if (normRoot === '') return `${normKey}/`; if (normKey.startsWith(`${normRoot}/`)) return `${normKey.slice(normRoot.length + 1)}/`; return null; }, @@ -1766,7 +1765,7 @@ function Catalogue({ admin, user }: { admin: boolean; user: User | null }) { // indented rows have to come in. for (const dir of [...(foldersUnder.get(lowerF) ?? [])].sort((a, b) => a.localeCompare(b))) { const parts = dir.split('/'); - const key = normF ? `${normF}/${dir}` : dir; + const key = `${normF}/${dir}`; out.push({ key, label: parts[parts.length - 1], diff --git a/docker/frontend/src/engine/library.ts b/docker/frontend/src/engine/library.ts index 1808b2a..dd9da83 100644 --- a/docker/frontend/src/engine/library.ts +++ b/docker/frontend/src/engine/library.ts @@ -1390,7 +1390,11 @@ export async function scanFolder( // been read once before is a reading of a hundred thousand frames even while // the walk is still up in its first folders, and one kept to a subfolder is // measured against the frames under that one alone. - const heldPrefix = `${folder.name}/${from}`.toLowerCase(); + // An id is `normPath(folder.name)/…`, and a drive root is named `\`, which + // `normPath` spells `''` — so the frames of such a roll's subfolder are filed + // under `/Roll/…`, and a prefix built as `${folder.name}/${from}` spells + // `\/Roll` and counts nought of them held. + const heldPrefix = `${normPath(folder.name)}/${normPath(from)}`.toLowerCase(); const held = bounded ? rawKnown.filter((p) => p.id.toLowerCase().startsWith(heldPrefix)).length : rawKnown.length;