mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-21 21:22:11 -03:00
fix: Handle missing Civitai API response fields gracefully
Fix KeyError when 'hashes', 'name', or 'model' fields are missing from Civitai API responses. Use .get() with defaults instead of direct dict access in: - LoraMetadata.from_civitai_info() - CheckpointMetadata.from_civitai_info() - EmbeddingMetadata.from_civitai_info() - RecipeScanner._get_hash_from_civitai() - DownloadManager._process_download() Fixes #820
This commit is contained in:
@@ -496,7 +496,9 @@ class DownloadManager:
|
||||
return {"success": False, "error": "No mirror URL found"}
|
||||
|
||||
# 3. Prepare download
|
||||
file_name = file_info["name"]
|
||||
file_name = file_info.get("name", "")
|
||||
if not file_name:
|
||||
return {"success": False, "error": "No filename found in file info"}
|
||||
save_path = os.path.join(save_dir, file_name)
|
||||
|
||||
# 5. Prepare metadata based on model type
|
||||
|
||||
Reference in New Issue
Block a user