diff --git a/scripts/generate_site.py b/scripts/generate_site.py index 215f50a4..b6475431 100644 --- a/scripts/generate_site.py +++ b/scripts/generate_site.py @@ -2304,6 +2304,13 @@ def _render_emulator_file( lines.append(f"- {d}") if fnote: lines.append(f"- {_escape_tags(str(fnote))}") + if not in_repo and f.get("unsourceable"): + # The badge alone sent readers after a dump that cannot exist; the + # reason was only on the gaps page, which the card did not link. + lines.append( + f"- Not collectable: {_escape_tags(str(f['unsourceable']))} " + "([acknowledged gaps](../gaps.md#acknowledged-gaps))" + ) if contents: # Every member with the hashes the emulator checks: MAME and FBNeo # verify the members, never the archive, so a member's crc32 is the diff --git a/tests/test_audit_regressions.py b/tests/test_audit_regressions.py index 65e8e025..a929f56b 100644 --- a/tests/test_audit_regressions.py +++ b/tests/test_audit_regressions.py @@ -4498,5 +4498,22 @@ class GapsPageCountsOneWay(unittest.TestCase): self.assertEqual(result["settled_by"], "arcade") + +class UnsourceableCardSaysWhy(unittest.TestCase): + """DraStic's nds_firmware_modified.bin carried an 'unsourceable' badge + and nothing else; the reason was only on the gaps page.""" + + def test_reason_and_link(self): + from scripts.generate_site import _render_emulator_file + + entry = {"name": "nds_firmware_modified.bin", "path": "x.bin", + "unsourceable": "written by the firmware editor, so no dump of it exists"} + text = "\n".join(_render_emulator_file( + entry, {"files": [entry]}, None, [entry], lambda f: False, "file-x", + )) + self.assertIn("Not collectable: written by the firmware editor", text) + self.assertIn("../gaps.md#acknowledged-gaps", text) + + if __name__ == "__main__": unittest.main()