f
This commit is contained in:
@@ -2066,9 +2066,9 @@ def _derive_title(
|
||||
"original_display_filename",
|
||||
"original_filename",
|
||||
):
|
||||
value = entry.get(key)
|
||||
if isinstance(value, str):
|
||||
cleaned = value.strip()
|
||||
raw_val = entry.get(key)
|
||||
if isinstance(raw_val, str):
|
||||
cleaned = raw_val.strip()
|
||||
if cleaned:
|
||||
return cleaned
|
||||
return None
|
||||
@@ -2444,7 +2444,7 @@ def fetch_hydrus_metadata_by_url(payload: Dict[str, Any]) -> Dict[str, Any]:
|
||||
matched_url = None
|
||||
normalized_reported = None
|
||||
seen: Set[str] = set()
|
||||
queue = deque()
|
||||
queue: deque[str] = deque()
|
||||
for variant in _generate_hydrus_url_variants(url):
|
||||
queue.append(variant)
|
||||
if not queue:
|
||||
@@ -2486,11 +2486,11 @@ def fetch_hydrus_metadata_by_url(payload: Dict[str, Any]) -> Dict[str, Any]:
|
||||
if isinstance(raw_hashes, list):
|
||||
for item in raw_hashes:
|
||||
try:
|
||||
normalized = _normalize_hash(item)
|
||||
norm_hash = _normalize_hash(item)
|
||||
except ValueError:
|
||||
continue
|
||||
if normalized:
|
||||
response_hashes_list.append(normalized)
|
||||
if norm_hash:
|
||||
response_hashes_list.append(norm_hash)
|
||||
raw_ids = response.get("file_ids") or response.get("file_id")
|
||||
if isinstance(raw_ids, list):
|
||||
for item in raw_ids:
|
||||
@@ -2510,12 +2510,13 @@ def fetch_hydrus_metadata_by_url(payload: Dict[str, Any]) -> Dict[str, Any]:
|
||||
continue
|
||||
status_hash = entry.get("hash") or entry.get("file_hash")
|
||||
if status_hash:
|
||||
norm_status: Optional[str] = None
|
||||
try:
|
||||
normalized = _normalize_hash(status_hash)
|
||||
norm_status = _normalize_hash(status_hash)
|
||||
except ValueError:
|
||||
normalized = None
|
||||
if normalized:
|
||||
response_hashes_list.append(normalized)
|
||||
pass
|
||||
if norm_status:
|
||||
response_hashes_list.append(norm_status)
|
||||
status_id = entry.get("file_id") or entry.get("fileid")
|
||||
if status_id is not None:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user