fix(routes): enhance model processing to include checks for missing tags, description, and creator

This commit is contained in:
Will Miao
2025-09-10 23:30:08 +08:00
parent a7df8ae15c
commit 1b5e608a27
2 changed files with 29 additions and 31 deletions

View File

@@ -611,10 +611,19 @@ class BaseModelRoutes(ABC):
success = 0
needs_resort = False
# Prepare models to process, only those without CivitAI data
# Prepare models to process, only those without CivitAI data or missing tags, description, or creator
to_process = [
model for model in cache.raw_data
if model.get('sha256') and (not model.get('civitai') or 'id' not in model.get('civitai'))
if (
model.get('sha256')
and (
not model.get('civitai')
or not model['civitai'].get('id')
or not model.get('tags')
or not model.get('modelDescription')
or not (model.get('civitai') and model['civitai'].get('creator'))
)
)
]
total_to_process = len(to_process)