fix: check the zipped_file member before composite

A one-member archive whose member carries the zipped_file md5 under
another name has that md5 as its composite. The name step returned it as
md5_composite_exact, which slots and the site take as content proof, while
Batocera looks the member up by name and finds nothing.
This commit is contained in:
Abdessamad Derraz committed 2026-11-05 11:45:58 +01:00
1 parent 08cf4dd914
commit cfc2515909
2 files changed
+41 -1

No files matched your search

+7 -1
View File
@@ -1657,7 +1657,13 @@ def resolve_local_file(
if ".zip" in os.path.basename(path):
try:
composite = md5_composite(path).lower()
if composite in md5_set:
# A zipped_file md5 is the member's: one member of
# another name has the same composite, and Batocera
# looks the member up by name.
if composite in md5_set and (
not zipped_file
or check_inside_zip(path, zipped_file, composite) == "ok"
):
return path, "md5_composite_exact"
except (zipfile.BadZipFile, OSError) as exc:
_warn_unreadable_archive(path, exc)