fix(recipe): validate modelVersionId before fetching hash from cache or Civitai

This commit is contained in:
Will Miao
2025-09-28 09:18:59 +08:00
parent 656e3e43be
commit d0fe28cfe2

View File

@@ -424,6 +424,8 @@ class RecipeScanner:
# If has modelVersionId but no hash, look in lora cache first, then fetch from Civitai # If has modelVersionId but no hash, look in lora cache first, then fetch from Civitai
if 'modelVersionId' in lora and not lora.get('hash'): if 'modelVersionId' in lora and not lora.get('hash'):
model_version_id = lora['modelVersionId'] model_version_id = lora['modelVersionId']
# Check if model_version_id is an integer and > 0
if isinstance(model_version_id, int) and model_version_id > 0:
# Try to find in lora cache first # Try to find in lora cache first
hash_from_cache = await self._find_hash_in_lora_cache(model_version_id) hash_from_cache = await self._find_hash_in_lora_cache(model_version_id)