mirror of
https://github.com/rommapp/romm.git
synced 2026-06-28 06:46:00 +00:00
CHD files now follow the same hash logic as all other file types — CRC32, MD5, and SHA1 are computed from raw container bytes. This allows ScreenScraper to log KO entries for unrecognised CHD files, which it could not do when only the disc-data SHA1 was being computed. The CHD header SHA1 (disc-data SHA1) is separately extracted and stored in a new chd_sha1_hash field on RomFile, with a migration adding the column to rom_files. Hasheous receives only this disc-data SHA1 (no CRC/MD5) since it indexes disc-based games by disc-data SHA1, not raw file hashes. The RAHasher multi-file path now passes the largest CHD directly instead of a /* wildcard, which RAHasher cannot expand. Hash computations are wrapped in asyncio.to_thread to avoid blocking the event loop during large reads. Hash-lookup metadata handlers (ScreenScraper, Hasheous, Playmatch) now fall back to rom.files (stored DB hashes) when fs_rom files are not rehashed, fixing hash-based matching for UNMATCHED and UPDATE scan types. The Disc SHA-1 is displayed in the ROM detail view for both single-file (FileInfo.vue) and multi-file (FileSelectItem.vue) CHD games.