feat(metadata): enhance model processing with CivitAI metadata checks and new fields for archive DB status

This commit is contained in:
Will Miao
2025-09-19 23:22:47 +08:00
parent f3544b3471
commit 3053b13fcb
4 changed files with 33 additions and 36 deletions

View File

@@ -626,18 +626,16 @@ class BaseModelRoutes(ABC):
# Prepare models to process, only those without CivitAI data
enable_metadata_archive_db = settings.get('enable_metadata_archive_db', False)
# Filter models that need CivitAI metadata update
to_process = [
model for model in cache.raw_data
if (
model.get('sha256')
and (
not model.get('civitai')
or not model['civitai'].get('id')
)
and (
(enable_metadata_archive_db)
or (not enable_metadata_archive_db and model.get('from_civitai') is True)
)
if model.get('sha256')
and (
not model.get('civitai') or not model['civitai'].get('id')
)
and (
(enable_metadata_archive_db and not model.get('db_checked', False))
or (not enable_metadata_archive_db and model.get('from_civitai') is True)
)
]
total_to_process = len(to_process)