more logging
This commit is contained in:
@@ -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}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user