From e9a703451ca9a1c07eaa2a1777e13739ec94db31 Mon Sep 17 00:00:00 2001 From: Will Miao <13051207myq@gmail.com> Date: Wed, 12 Mar 2025 15:25:58 +0800 Subject: [PATCH] Fix the problem of repeatedly trying to fetch model description metadata when the model has a null description. --- py/services/civitai_client.py | 2 +- py/services/lora_scanner.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/py/services/civitai_client.py b/py/services/civitai_client.py index ce0854a7..a39be20f 100644 --- a/py/services/civitai_client.py +++ b/py/services/civitai_client.py @@ -190,7 +190,7 @@ class CivitaiClient: # Extract relevant metadata metadata = { - "description": data.get("description", ""), + "description": data.get("description") or "No model description available", "tags": data.get("tags", []) } diff --git a/py/services/lora_scanner.py b/py/services/lora_scanner.py index 8b764b6d..d7ed0986 100644 --- a/py/services/lora_scanner.py +++ b/py/services/lora_scanner.py @@ -410,7 +410,7 @@ class LoraScanner: # Fetch missing metadata if needed if needs_metadata_update and model_id: - logger.info(f"Fetching missing metadata for {file_path} with model ID {model_id}") + logger.debug(f"Fetching missing metadata for {file_path} with model ID {model_id}") from ..services.civitai_client import CivitaiClient client = CivitaiClient() @@ -431,7 +431,7 @@ class LoraScanner: # Process valid metadata if available elif model_metadata: - logger.info(f"Updating metadata for {file_path} with model ID {model_id}") + logger.debug(f"Updating metadata for {file_path} with model ID {model_id}") # Update tags if they were missing if model_metadata.get('tags') and (not lora_data.get('tags') or len(lora_data.get('tags', [])) == 0):