mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-20 10:23:16 -05:00
fix: show the sha256 a platform declares
This commit is contained in:
1 parent
435564c728
commit
4d360c3cc1
2 files changed
+16
-2
No files matched your search
@@ -1369,7 +1369,7 @@ def platform_structured_data(name: str, coverage: dict) -> dict:
|
||||
}
|
||||
identifiers = [
|
||||
f"{field}:{value}"
|
||||
for field in ("sha1", "md5", "crc32")
|
||||
for field in ("sha1", "md5", "crc32", "sha256")
|
||||
for value in _hash_values(entry.get(field))
|
||||
]
|
||||
if identifiers:
|
||||
@@ -1733,7 +1733,10 @@ def _render_platform_systems(
|
||||
# System.dat and clrmamepro print, and pasting it found nothing
|
||||
# for a pinned file the collection holds under other bytes.
|
||||
crc32 = str(cfg_entry.get("crc32") or "")
|
||||
if sha1 or md5 or crc32:
|
||||
# RetroDECK declares sha256 too: dsifirmware.bin's was in the CSV
|
||||
# exports only, and pasting it into the search found nothing.
|
||||
sha256 = str(cfg_entry.get("sha256") or "")
|
||||
if sha1 or md5 or crc32 or sha256:
|
||||
hash_parts = []
|
||||
if sha1:
|
||||
hash_parts.append(f"SHA1: `{sha1}`")
|
||||
@@ -1741,6 +1744,8 @@ def _render_platform_systems(
|
||||
hash_parts.append(f"MD5: `{md5}`")
|
||||
if crc32:
|
||||
hash_parts.append(f"CRC32: `{crc32}`")
|
||||
if sha256:
|
||||
hash_parts.append(f"SHA256: `{sha256}`")
|
||||
lines.append(f"{pad} {' | '.join(hash_parts)}")
|
||||
|
||||
lines.append("")
|
||||
|
||||
@@ -500,6 +500,15 @@ class PlatformPagesCarryTheirDeclarations(unittest.TestCase):
|
||||
self.assertEqual(part["identifier"], ["md5:490f666e"])
|
||||
self.assertTrue(part["url"].endswith("platforms/batocera/#sony-playstation"))
|
||||
|
||||
def test_a_declared_sha256_is_published(self):
|
||||
"""RetroDECK's dsifirmware.bin sha256 lived in the CSV exports only."""
|
||||
from generate_site import platform_structured_data
|
||||
|
||||
data = platform_structured_data("retrodeck", {"platform": "RetroDECK", "config": {
|
||||
"systems": {"nds": {"files": [
|
||||
{"name": "dsifirmware.bin", "sha256": "11A150E3"}]}}}})
|
||||
self.assertEqual(data["hasPart"][0]["identifier"], ["sha256:11a150e3"])
|
||||
|
||||
|
||||
|
||||
class AnEmulatorPageLinksItsProfile(unittest.TestCase):
|
||||
|
||||
Reference in new issue
Block a user