more logging

This commit is contained in:
2026-05-17 18:15:49 -04:00
parent 1b1ac6159a
commit 5a96eb385d

View File

@@ -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}`);
}
}