{scanPhaseLabel(scanPhase, scanValue)}
+ {scanCounts && ( ++ {scanCounts.dirs.toLocaleString()} folders · {scanCounts.files.toLocaleString()} files + {scanElapsed > 0 && · {formatDuration(scanElapsed)}} +
+ )} {scanPath ? ()} - {!isSearching && !hasSearched && ( + {!isSearching && !isScanning && !hasSearched && (
Search your device
diff --git a/src/app/locate-db.ts b/src/app/locate-db.ts index bc91136..35c1c09 100644 --- a/src/app/locate-db.ts +++ b/src/app/locate-db.ts @@ -173,8 +173,10 @@ export type ScanPhase = 'scanning' | 'building' | 'saving' | 'compressing'; * building → number of entries inserted so far * saving → bytes of the serialized DB written to the server */ +export type ScanCounts = { dirs: number; files: number }; + export async function buildLocateDb( - onProgress?: (phase: ScanPhase, value: number, path?: string) => void, + onProgress?: (phase: ScanPhase, value: number, path?: string, counts?: ScanCounts) => void, signal?: AbortSignal, ): Promise<{ count: number; bytes: number }> { signal?.throwIfAborted(); @@ -186,6 +188,8 @@ export async function buildLocateDb( const entries: Awaited