fix: count a catalogued dump once across its DATs

Several DATs list the same dump, as No-Intro's three FM-7 sets do
for their system ROMs, and the provenance report counted it once per
listing: 2485 missing announced for 2284 distinct dumps, on the site
as well. Dumps are now counted by identity, each keeping the DATs
that list it.
This commit is contained in:
Abdessamad Derraz committed 2026-10-18 06:11:12 +02:00
1 parent e1b6aad51b
commit fd4c118a38
3 files changed
+65 -9

No files matched your search

+4 -3
View File
@@ -65,7 +65,7 @@ from generate_readme import (
release_totals,
)
from profile_sync import source_ref_values, split_source_ref
from provenance_report import build_report
from provenance_report import build_report, distinct_missing
import release_record
import upstream
@@ -1774,7 +1774,7 @@ def generate_provenance_page(db: dict, report: dict) -> str:
]
)
total_missing = sum(len(d["missing"]) for d in report.values())
total_missing = distinct_missing(report)
lines.extend(
[
"## Wanted: catalogued dumps this project does not have",
@@ -1795,7 +1795,8 @@ def generate_provenance_page(db: dict, report: dict) -> str:
label = _PROVENANCE_LABELS.get(source, source)
by_dat: dict[str, list] = {}
for entry in data["missing"]:
by_dat.setdefault(entry.get("dat", ""), []).append(entry)
for dat in entry.get("dats") or [entry.get("dat", "")]:
by_dat.setdefault(dat, []).append(entry)
lines.extend([f"### {label}", ""])
for dat in sorted(by_dat):
entries = by_dat[dat]