From eb8f60aef7f27a13ffc944342ab85d69dbf0b679 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Mon, 9 Nov 2026 12:45:56 +0100 Subject: [PATCH] fix: write retrobat group and optional back The export dropped the two fields Program.cs reads besides md5 and file: an empty truth no longer handed RetroBat's list back as written. --- scripts/exporter/retrobat_exporter.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/exporter/retrobat_exporter.py b/scripts/exporter/retrobat_exporter.py index bba1d4496..71f010aa1 100644 --- a/scripts/exporter/retrobat_exporter.py +++ b/scripts/exporter/retrobat_exporter.py @@ -131,7 +131,7 @@ class Exporter(BaseExporter): output[key] = base[key] continue system, files = exportable[key] - ours: OrderedDict[str, OrderedDict[str, str]] = OrderedDict() + ours: OrderedDict[str, OrderedDict[str, object]] = OrderedDict() # The checker reads one md5 per biosFiles item and reports the # item by its path, so a path holds one item. An addition whose # path the platform or an earlier addition holds is not written. @@ -141,9 +141,16 @@ class Exporter(BaseExporter): if fe.platform is None and (path in claimed or path in ours): self._merged.add(id(fe)) continue - entry: OrderedDict[str, str] = OrderedDict() + entry: OrderedDict[str, object] = OrderedDict() entry["md5"] = self.single_value(fe, "md5") entry["file"] = path + # The two fields Program.cs reads besides md5 and file, as the + # scraper took them: group (one held file is enough) and + # optional (required: false). + if fe.platform is not None and fe.platform.get("group"): + entry["group"] = str(fe.platform["group"]) + if fe.platform is not None and fe.platform.get("required") is False: + entry["optional"] = True ours.setdefault(path, entry) bios_files = [] for theirs in (base.get(key) or {}).get("biosFiles", []):