refactor: read declared hashes with one helper

core.hashing.declared_hash_lists gives an entry's declared values per
field in the order written, and declared_hashes builds its sets on it.
The gap page, the doubled-destination report and the file lookup used
their own copies of that reader. The wanted page keeps its filters on
top of it. sitegen.lookup.hash_pairs replaces sorted_hash_values for
the lookup, the data exports and the structured data. The one-field
aliases parse_md5_list and reconcile.hash_values are gone, and
model.profiles reads HASH_FIELDS instead of a fourth tuple.
This commit is contained in:
Abdessamad Derraz committed 2026-11-21 10:29:37 +01:00
1 parent ea68e85c06
commit 02969dda06
30 files changed
+176 -195

No files matched your search

+7 -7
View File
@@ -35,7 +35,7 @@ from unittest import mock
from model import largefiles
import yaml
from core.ziptools import build_zip_contents_index, check_inside_zip, safe_extract_zip
from core.hashing import compute_hashes, md5_composite, parse_md5_list
from core.hashing import compute_hashes, md5_composite, parse_hash_list
from model.declarations import expand_platform_declared_names
from resolve.grouping import group_identical_platforms
from model.profiles import load_emulator_profiles
@@ -1726,12 +1726,12 @@ class TestE2E(unittest.TestCase):
self.assertIsNone(path)
self.assertEqual(status, "not_found")
def test_106_parse_md5_list(self):
"""parse_md5_list normalizes comma-separated MD5s."""
self.assertEqual(parse_md5_list(""), [])
self.assertEqual(parse_md5_list("ABC123"), ["abc123"])
self.assertEqual(parse_md5_list("abc, DEF , ghi"), ["abc", "def", "ghi"])
self.assertEqual(parse_md5_list(",,,"), [])
def test_106_parse_hash_list(self):
"""parse_hash_list normalizes comma-separated MD5s."""
self.assertEqual(parse_hash_list(""), [])
self.assertEqual(parse_hash_list("ABC123"), ["abc123"])
self.assertEqual(parse_hash_list("abc, DEF , ghi"), ["abc", "def", "ghi"])
self.assertEqual(parse_hash_list(",,,"), [])
def test_107filter_files_by_mode(self):
"""filter_files_by_mode filters standalone/libretro correctly."""