docs: describe short md5 handling as the code does

No platform YAML holds an md5 shorter than 32 characters: the Batocera scraper completes one when a single collection md5 starts with it. The pages said some entries carry 29 characters and that scrapers store them as-is.
This commit is contained in:
Abdessamad Derraz committed 2026-10-21 09:54:57 +02:00
1 parent a6d37e40ae
commit d8e9ad23d3
8 files changed
+44 -15

No files matched your search

+4 -2
View File
@@ -206,8 +206,10 @@ System ID consistency matters for cross-platform operations. The same console mu
- Handle missing hashes gracefully (set to `None`, not empty string).
- Some platforms provide multiple hash types per entry. Populate whichever fields
are available.
- Batocera uses 29-character truncated MD5 hashes in some entries. The resolution
layer handles prefix matching, but the scraper should store the hash as-is.
- An MD5 shorter than 32 characters is completed when exactly one MD5 in
`database.json` starts with it, as the Batocera scraper does
(`_resolve_truncated_md5`), and kept as written otherwise. The resolution layer
matches what remains by prefix.
Scraped data reflects what the upstream declares, which may not match reality. The scraper's job is faithful transcription of upstream data, not correction. Corrections happen in the emulator profiles (source-verified) and in `_shared.yml` (curated). If a scraper meets a hash or filename that differs from the emulator source, log a warning and still include the upstream value. The divergence will surface during truth diffing.
+1 -1
View File
@@ -372,7 +372,7 @@ platform's own verification mode.
| Case | Handling |
|------|---------|
| Batocera truncated MD5 (29 chars) | prefix match in resolution |
| MD5 shorter than 32 characters | completed by the Batocera scraper when one MD5 in the collection starts with it, matched by prefix in resolution |
| `zippedFile` entries | MD5 is of the ROM inside the ZIP, not the ZIP itself |
| Regional variants (same filename) | `by_path_suffix` index disambiguates |
| MAME BIOS ZIPs | `contents` field documents inner structure |
+7 -6
View File
@@ -47,13 +47,14 @@ hashed with MD5, and compared case-insensitively against the expected value.
If the `resolve_local_file` step already confirmed the MD5 match (status `md5_exact`),
`verify.py` skips re-hashing and returns OK directly.
### Truncated MD5 (Batocera)
### MD5 shorter than 32 characters (Batocera)
Some entries in Batocera's system data carry 29-character MD5 strings instead of
the usual 32. Batocera's script compares the full string (`batocera-systems:1088`), so
those entries report the file as untested. `verify.py` compares the prefix instead, to
find the file the entry designates: if the expected hash is shorter than 32 characters,
the actual hash is compared against only its first N characters.
Batocera's script compares the full string (`batocera-systems:1088`), so an MD5
shorter than 32 characters matches no file there. The Batocera scraper completes such
a value when exactly one MD5 in `database.json` starts with it
(`_resolve_truncated_md5` in `scripts/scraper/batocera_scraper.py`) and keeps it as
written otherwise. `resolve_local_file` matches a value still shorter than 32
characters by prefix, and only for a file whose name the entry also names.
### md5_composite (Recalbox ZIP verification)