fix: compare declared hashes in one place

This commit is contained in:
Abdessamad Derraz committed 2026-11-21 06:01:30 +01:00
1 parent e3294d08ea
commit e462b03848
12 files changed
+93 -97

No files matched your search

+2 -2
View File
@@ -15,7 +15,7 @@ from pathlib import Path
from model.database import record_at
from model.largefiles import fetch_large_file
from core.hashing import cut_md5_owner, parse_hash_list
from core.hashing import HASH_FIELDS, cut_md5_owner, parse_hash_list
from resolve.content import declared_hash_verdict
from resolve.localfile import resolution_is_hash_exact, resolve_local_file
from core.paths import REPO_ROOT, declared_destination
@@ -88,7 +88,7 @@ def download_external(
def _declared_hashes(file_entry: dict) -> dict[str, list[str]]:
return {
field: parse_hash_list(file_entry.get(field))
for field in ("sha1", "md5", "sha256", "crc32")
for field in HASH_FIELDS
}