refactor(metadata): update model fetching methods to return error messages alongside results

This commit is contained in:
Will Miao
2025-09-19 16:36:34 +08:00
parent fc6f1bf95b
commit 1610048974
7 changed files with 66 additions and 175 deletions

View File

@@ -55,7 +55,7 @@ class RecipeMetadataParser(ABC):
# Unpack the tuple to get the actual data
civitai_info, error_msg = civitai_info_tuple if isinstance(civitai_info_tuple, tuple) else (civitai_info_tuple, None)
if not civitai_info or civitai_info.get("error") == "Model not found":
if not civitai_info or error_msg == "Model not found":
# Model not found or deleted
lora_entry['isDeleted'] = True
lora_entry['thumbnailUrl'] = '/loras_static/images/no-preview.png'