mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-21 21:22:11 -03:00
feat(metadata): prevent overwriting high-quality Civitai API metadata with archive data. See #764
- Update `is_civitai_api_metadata` to exclude both "archive_db" and "civarchive" sources - Skip Civitai metadata updates when existing metadata is higher quality than incoming archive data - Add test to verify API metadata is preserved when CivArchive provides lower-quality data
This commit is contained in:
@@ -76,7 +76,7 @@ class MetadataSyncService:
|
||||
files = meta.get("files")
|
||||
images = meta.get("images")
|
||||
source = meta.get("source")
|
||||
return bool(files) and bool(images) and source != "archive_db"
|
||||
return bool(files) and bool(images) and source not in ("archive_db", "civarchive")
|
||||
|
||||
async def update_model_metadata(
|
||||
self,
|
||||
@@ -90,11 +90,11 @@ class MetadataSyncService:
|
||||
existing_civitai = local_metadata.get("civitai") or {}
|
||||
|
||||
if (
|
||||
civitai_metadata.get("source") == "archive_db"
|
||||
not self.is_civitai_api_metadata(civitai_metadata)
|
||||
and self.is_civitai_api_metadata(existing_civitai)
|
||||
):
|
||||
logger.info(
|
||||
"Skip civitai update for %s (%s)",
|
||||
"Skip civitai update for %s (%s) - existing metadata is higher quality",
|
||||
local_metadata.get("model_name", ""),
|
||||
existing_civitai.get("name", ""),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user