mirror of
https://github.com/Abdess/retrobios.git
synced 2026-06-21 11:12:47 +00:00
feat: complete retrobat coverage, fix large file resolution
This commit is contained in:
parent
a443ba74e8
commit
0ffb8cbd0d
29 changed files with 681 additions and 197 deletions
|
|
@ -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"
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue