refactor: find held records by the resolver rule

The gap report counted a file held on any crc32 hit, without the declared size and even against a contradicting stronger hash. The pack check split md5 lists by hand and took a loose ROM for the member a zipped_file md5 names. Both now ask held_record_for, the resolver's hash steps. The pack check still compares whole digests, as Batocera does, so a cut md5 names a file without satisfying it.

records_for_hash returns every held record an index value names. The variant search reads it instead of its own kind-to-index table. Any one accepted value still nominates a candidate there, because the validation index merges what several emulators accept and their own checks judge each file.
This commit is contained in:
Abdessamad Derraz committed 2026-11-21 10:30:40 +01:00
1 parent 4acfd8f763
commit 331f244aac
8 files changed
+178 -55

No files matched your search

+2 -1
View File
@@ -34,7 +34,8 @@ def _index(**over) -> dict:
class GapReportSources(unittest.TestCase):
def test_a_sha256_alone_finds_the_file(self):
entry = {"name": "wave1.bin", "sha256": "AB" * 32}
self.assertEqual(entry_source(entry, _index(by_sha256={"ab" * 32: "s"})), "bios")
index = _index(by_sha256={"ab" * 32: "s"}, db_files={"s": {"sha256": "ab" * 32}})
self.assertEqual(entry_source(entry, index), "bios")
def test_a_name_never_wins_over_a_declared_hash(self):
"""zquestclassic pins ending.mid by sha1, the collection holds only