feat(civitai): enhance metadata fetching with error handling and cache validation

This commit is contained in:
Will Miao
2025-09-20 21:35:34 +08:00
parent ab7266f3a4
commit a8d7070832
3 changed files with 65 additions and 31 deletions

View File

@@ -53,7 +53,7 @@ class MetadataUpdater:
async def update_cache_func(old_path, new_path, metadata):
return await scanner.update_single_model_cache(old_path, new_path, metadata)
success = await ModelRouteUtils.fetch_and_update_model(
success, error = await ModelRouteUtils.fetch_and_update_model(
model_hash,
file_path,
model_data,
@@ -64,7 +64,7 @@ class MetadataUpdater:
logger.info(f"Successfully refreshed metadata for {model_name}")
return True
else:
logger.warning(f"Failed to refresh metadata for {model_name}")
logger.warning(f"Failed to refresh metadata for {model_name}, {error}")
return False
except Exception as e: