This commit is contained in:
2026-02-07 14:32:33 -08:00
parent af54acda3c
commit c8230cbb42
2 changed files with 44 additions and 9 deletions

View File

@@ -397,6 +397,24 @@ class HydrusNetwork(Store):
if isinstance(hashes, list) and hashes:
hydrus_hash = hashes[0]
if isinstance(hydrus_hash, (bytes, bytearray)):
try:
hydrus_hash = bytes(hydrus_hash).hex()
except Exception:
hydrus_hash = None
if hydrus_hash:
try:
hydrus_hash = str(hydrus_hash).strip().lower()
except Exception:
hydrus_hash = None
if not hydrus_hash or len(str(hydrus_hash)) != 64:
debug(
f"{self._log_prefix()} Hydrus response hash missing/invalid; using precomputed hash"
)
hydrus_hash = file_hash
if not hydrus_hash:
raise Exception(f"Hydrus response missing file hash: {response}")