fix: resolve_file skips MD5 lookup for zipped_file entries

Same guard as verify.py: when zipped_file is set, the md5 is for the
inner ROM, not the container ZIP. Direct MD5 lookup resolved to the
standalone ROM file instead of the ZIP parent.

Fixes: ep64.zip/ep128.zip (Enterprise) written as raw ROM data instead
of ZIP archives in Batocera pack. Also fixes any other zipped_file entry
where the inner ROM MD5 matched a standalone file in the database.

Also: update Dinothawr.zip SHA1 in retroarch.yml to match actual file.
This commit is contained in:
Abdessamad Derraz
2026-03-18 06:13:22 +01:00
parent 84ab0ea6d3
commit 040ea9f217
2 changed files with 5 additions and 4 deletions

View File

@@ -121,7 +121,9 @@ def resolve_file(file_entry: dict, db: dict, bios_dir: str,
if os.path.exists(local_path):
return local_path, "exact"
if md5:
# Skip MD5 direct lookup for zipped_file entries: the md5 is for the inner ROM,
# not the container ZIP. Matching it would resolve to the standalone ROM file.
if md5 and not zipped_file:
sha1_from_md5 = db.get("indexes", {}).get("by_md5", {}).get(md5)
if sha1_from_md5 and sha1_from_md5 in db["files"]:
local_path = db["files"][sha1_from_md5]["path"]