f
This commit is contained in:
@@ -2446,7 +2446,7 @@ class Download_File(Cmdlet):
|
||||
return out
|
||||
|
||||
@staticmethod
|
||||
def _normalise_hash_hex(value: Optional[str]) -> Optional[str]:
|
||||
def _normalize_hash_hex(value: Optional[str]) -> Optional[str]:
|
||||
if not value or not isinstance(value, str):
|
||||
return None
|
||||
candidate = value.strip().lower()
|
||||
@@ -2460,7 +2460,7 @@ class Download_File(Cmdlet):
|
||||
return None
|
||||
for key in ("hash", "hash_hex", "file_hash", "hydrus_hash"):
|
||||
v = hit.get(key)
|
||||
normalized = cls._normalise_hash_hex(str(v) if v is not None else None)
|
||||
normalized = cls._normalize_hash_hex(str(v) if v is not None else None)
|
||||
if normalized:
|
||||
return normalized
|
||||
return None
|
||||
@@ -2553,10 +2553,10 @@ class Download_File(Cmdlet):
|
||||
|
||||
hashes: List[str] = []
|
||||
for po in pipe_objects:
|
||||
h_val = cls._normalise_hash_hex(str(po.get("hash") or ""))
|
||||
h_val = cls._normalize_hash_hex(str(po.get("hash") or ""))
|
||||
hashes.append(h_val or "")
|
||||
|
||||
king_hash = cls._normalise_hash_hex(source_king_hash) if source_king_hash else None
|
||||
king_hash = cls._normalize_hash_hex(source_king_hash) if source_king_hash else None
|
||||
if not king_hash:
|
||||
king_hash = hashes[0] if hashes and hashes[0] else None
|
||||
if not king_hash:
|
||||
|
||||
Reference in New Issue
Block a user