mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-24 18:47:53 -06:00
refactor: read validation checks in one place
This commit is contained in:
1 parent
39e6d57fcb
commit
bf777d321f
2 files changed
+19
-31
No files matched your search
@@ -18,6 +18,7 @@ from resolve.content import (
|
||||
content_fits,
|
||||
declared_content_checks,
|
||||
name_match_size_ok,
|
||||
parse_validation,
|
||||
shape_fits,
|
||||
)
|
||||
from resolve.archives import archive_members
|
||||
@@ -50,21 +51,6 @@ _CONTENT_REASONS = {
|
||||
_HASH_CHECKS = frozenset({"crc32", "md5", "sha1", "adler32"})
|
||||
|
||||
|
||||
def parse_validation(validation: list | dict | None) -> list[str]:
|
||||
"""Extract the validation check list from a file's validation field.
|
||||
|
||||
Handles both simple list and divergent (core/upstream) dict forms.
|
||||
For dicts, uses the ``core`` key since RetroArch users run the core.
|
||||
"""
|
||||
if validation is None:
|
||||
return []
|
||||
if isinstance(validation, list):
|
||||
return validation
|
||||
if isinstance(validation, dict):
|
||||
return validation.get("core", [])
|
||||
return []
|
||||
|
||||
|
||||
def _entry_rule(emu_name: str, f: dict, checks: Collection[str]) -> dict:
|
||||
"""One profile entry's own checks, kept apart from the merged view.
|
||||
|
||||
|
||||
Reference in new issue
Block a user