mirror of
https://github.com/rommapp/romm.git
synced 2026-06-28 06:46:00 +00:00
The scan was spending excessive time on large platforms even when all ROMs were already scanned. Root causes: per-ROM UPDATE queries for skipped ROMs (10k individual writes), missing composite index on (platform_id, fs_name) causing full table scans, NOT IN clauses with 10k+ values in mark_missing_roms(), and redundant filesystem reads. Changes: - Add bulk_mark_present() for batch-updating skipped ROMs in one query - Move skip detection from _identify_rom to the batch loop so skipped ROMs never enter the async scan pipeline, and report progress for them - Add composite index idx_roms_platform_id_fs_name via migration 0077 - Rewrite mark_missing_roms() with flip-based approach: mark all missing, then un-mark present ones in chunks of 1000 - Cache filesystem reads in scan_platforms() to avoid double directory traversal (precounting + scanning) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>