f
This commit is contained in:
@@ -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}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user