From 5a96eb385d75c7d19456bf96aee40aac508df2ef Mon Sep 17 00:00:00 2001 From: Garret Patti Date: Sun, 17 May 2026 18:15:49 -0400 Subject: [PATCH] more logging --- src/lib/server/scanner.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/server/scanner.ts b/src/lib/server/scanner.ts index 01a6429..5aabffd 100644 --- a/src/lib/server/scanner.ts +++ b/src/lib/server/scanner.ts @@ -186,9 +186,12 @@ export function scanLibraries(db: Database.Database): void { .prepare('SELECT id, folder_path FROM games WHERE library = ?') .all(library) as Array<{ id: number; folder_path: string }>; for (const row of existingGames) { - if (!fs.existsSync(row.folder_path)) { - console.log(`[scanner] removing stale game: ${row.folder_path}`); + const exists = fs.existsSync(row.folder_path); + if (!exists) { + console.log(`[scanner] cleanup: DELETING game — path not found: ${row.folder_path}`); db.prepare('DELETE FROM games WHERE id = ?').run(row.id); + } else { + console.log(`[scanner] cleanup: keeping game — path ok: ${row.folder_path}`); } }