fix: export only what the platform declares

This commit is contained in:
Abdessamad Derraz committed 2026-10-10 11:15:25 +02:00
1 parent b5f9095633
commit e26ee44229
9 files changed
+145 -5

No files matched your search

+5
View File
@@ -35,6 +35,9 @@ class BiosRequirement:
# is not always derivable from ours: libretro writes iplromco.dat bare
# but ep128emu/roms/cpc464.rom with its directory.
native_path: str | None = None
# The native system whose entry this one repeats under another system.
# The platform's own file does not carry the copy: an export skips it.
mirror_of: str | None = None
# Fields the platform declares that have no equivalent in our model.
# Kept verbatim so the native file can be written back unchanged.
native: dict[str, object] = field(default_factory=dict)
@@ -95,6 +98,8 @@ def requirement_entry(req: BiosRequirement) -> dict:
entry["native_system"] = req.native_id
if req.native_path and req.native_path != req.name:
entry["native_path"] = req.native_path
if req.mirror_of:
entry["mirror_of"] = req.mirror_of
for key in sorted(req.native):
value = req.native[key]
if value not in (None, "", [], {}):
+9 -3
View File
@@ -279,9 +279,14 @@ class Scraper(BaseScraper):
"docs": "https://docs.libretro.com/library/xrick/",
},
}
# Every entry below is ours, not System.dat's: marked curated so an
# export of System.dat does not take it for libretro's.
for sys_id, sys_data in EXTRA_SYSTEMS.items():
if sys_id not in systems:
systems[sys_id] = sys_data
systems[sys_id] = {
**sys_data,
"files": [{**f, "curated": True} for f in sys_data["files"]],
}
# Arcade BIOS present in the repo but absent from System.dat.
# FBNeo expects them in system/ or system/fbneo/.
@@ -310,7 +315,7 @@ class Scraper(BaseScraper):
existing = {f["name"] for f in systems["arcade"].get("files", [])}
for ef in EXTRA_ARCADE_FILES:
if ef["name"] not in existing:
systems["arcade"]["files"].append(ef)
systems["arcade"]["files"].append({**ef, "curated": True})
# segasp.zip for Sega System SP (Flycast)
if "sega-dreamcast-arcade" in systems:
@@ -323,6 +328,7 @@ class Scraper(BaseScraper):
"name": "segasp.zip",
"destination": "dc/segasp.zip",
"required": True,
"curated": True,
}
)
@@ -442,7 +448,7 @@ class Scraper(BaseScraper):
for ef in extra_files:
key = (ef["name"], ef.get("destination", ef["name"]))
if key not in existing:
systems[sys_id]["files"].append(ef)
systems[sys_id]["files"].append({**ef, "curated": True})
existing.add(key)
# ep128emu shared group for Enterprise
+1
View File
@@ -175,6 +175,7 @@ class Scraper(BaseScraper):
destination=f"{slug}/{filename}",
required=True,
native_id=slug,
mirror_of=None if slug == igdb_slug else igdb_slug,
)
)