fix: the collection DAT names sets by subfolder

The collection DAT named its sets "Sony - PlayStation", and the data page said it audits a copy of bios/. clrmamepro and RomVault looked for a folder of that name and reported the 330 sets missing. A Logiqx set name writes a subfolder with a backslash: Sony\PlayStation.
This commit is contained in:
Abdessamad Derraz committed 2026-10-20 06:17:16 +02:00
1 parent c64716d90e
commit 08396be3c6
2 files changed
+14 -8

No files matched your search

+9 -5
View File
@@ -1114,7 +1114,8 @@ def generate_data_page(exports: list[dict]) -> str:
"[Collection DAT](downloads/retrobios.dat){ .md-button }",
"",
"The DAT is Logiqx XML, the format clrmamepro and RomVault read: one game "
"per `bios/<Manufacturer>/<Console>/` folder of the collection, each file a "
"per `bios/<Manufacturer>/<Console>/` folder of the collection, named "
"`Manufacturer\\Console` so the tools look in that subfolder, each file a "
"rom named by its path below that folder. It audits a copy of the "
"collection's `bios/` tree, or rebuilds that layout from your own dumps. A "
"platform pack has its own layout and is checked with `install.py --check`.",
@@ -1289,9 +1290,9 @@ SYSTEM_PARTS_IN_FULL = 1000
def collection_dat(db: dict, generated_at: str) -> str:
"""The collection as a Logiqx DAT, the format clrmamepro and RomVault read.
One game per bios/<Manufacturer>/<Console>/ folder, each file a rom
named by its path below that folder, subfolders joined with a backslash
as Logiqx DATs write them. An auditor checking a BIOS tree against the
One game per bios/<Manufacturer>/<Console>/ folder, named
Manufacturer\\Console, each file a rom named by its path below that
folder, subfolders joined with a backslash as Logiqx DATs write them. An auditor checking a BIOS tree against the
collection had JSON, CSV and SQLite, and a converter to write.
"""
import xml.etree.ElementTree as ET # noqa: PLC0415
@@ -1302,7 +1303,10 @@ def collection_dat(db: dict, generated_at: str) -> str:
if len(parts) < 3 or parts[0] != "bios":
continue
folder = parts[1:3] if len(parts) > 3 else parts[1:2]
games.setdefault(" - ".join(folder), []).append(
# A backslash is how a Logiqx set name writes a subfolder: named
# "Sony - PlayStation", the set was looked for beside Sony/, and an
# audit of a copy of bios/ found 330 sets missing.
games.setdefault("\\".join(folder), []).append(
{**entry, "_rom": "\\".join(parts[1 + len(folder):])}
)
root = ET.Element("datafile")
+5 -3
View File
@@ -4901,9 +4901,11 @@ class TheCollectionShipsADat(unittest.TestCase):
dat = parse_logiqx(collection_dat(db, "2026-10-18T07:00:00Z"))
self.assertEqual(dat.version, "20261018")
roms = {(r.game, r.name): r for r in dat.roms}
self.assertIn(("Sony - PlayStation", "scph5501.bin"), roms)
self.assertIn(("Nintendo - GameCube", "GC\\USA\\IPL.bin"), roms)
self.assertEqual(roms[("Sony - PlayStation", "scph5501.bin")].crc32, "8d8cb7e4")
# The set name is the subfolder a copy of bios/ holds: named
# "Sony - PlayStation", clrmamepro looked beside Sony/ for it.
self.assertIn(("Sony\\PlayStation", "scph5501.bin"), roms)
self.assertIn(("Nintendo\\GameCube", "GC\\USA\\IPL.bin"), roms)
self.assertEqual(roms[("Sony\\PlayStation", "scph5501.bin")].crc32, "8d8cb7e4")