mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-04-13 20:32:32 -05:00
feat: complete retrobat coverage, fix large file resolution
This commit is contained in:
@@ -106,7 +106,12 @@ def resolve_file(file_entry: dict, db: dict, bios_dir: str,
|
||||
if os.path.exists(local_path):
|
||||
return local_path, "zip_exact"
|
||||
|
||||
# No MD5 specified = any file with that name is acceptable
|
||||
# Release assets override local files (authoritative large files)
|
||||
cached = fetch_large_file(name)
|
||||
if cached:
|
||||
return cached, "release_asset"
|
||||
|
||||
# No MD5 specified = any local file with that name is acceptable
|
||||
if not md5:
|
||||
name_matches = db.get("indexes", {}).get("by_name", {}).get(name, [])
|
||||
for match_sha1 in name_matches:
|
||||
@@ -115,6 +120,7 @@ def resolve_file(file_entry: dict, db: dict, bios_dir: str,
|
||||
if os.path.exists(local_path):
|
||||
return local_path, "exact"
|
||||
|
||||
# Name fallback (hash mismatch)
|
||||
name_matches = db.get("indexes", {}).get("by_name", {}).get(name, [])
|
||||
for match_sha1 in name_matches:
|
||||
if match_sha1 in db["files"]:
|
||||
@@ -122,11 +128,6 @@ def resolve_file(file_entry: dict, db: dict, bios_dir: str,
|
||||
if os.path.exists(local_path):
|
||||
return local_path, "hash_mismatch"
|
||||
|
||||
# Last resort: try downloading from large-files release
|
||||
cached = fetch_large_file(name)
|
||||
if cached:
|
||||
return cached, "release_asset"
|
||||
|
||||
return None, "not_found"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user