mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-24 22:52:12 -03:00
Revert "feat(civarchive_client): update get_model_version_info to resolve the real model/version IDs before fetching the target metadata."
This reverts commit c3a66ecf28.
This commit is contained in:
@@ -419,41 +419,10 @@ class CivArchiveClient:
|
|||||||
Returns:
|
Returns:
|
||||||
Tuple[Optional[Dict], Optional[str]]: (version_data, error_message)
|
Tuple[Optional[Dict], Optional[str]]: (version_data, error_message)
|
||||||
"""
|
"""
|
||||||
try:
|
version = await self.get_model_version(1, version_id)
|
||||||
lookup_payload, error = await self._request_json(
|
if version is None:
|
||||||
"/models/1",
|
return None, "Model not found"
|
||||||
params={"modelVersionId": version_id},
|
return version, None
|
||||||
)
|
|
||||||
if error or lookup_payload is None:
|
|
||||||
logger.error(f"Error performing CivArchive version lookup for {version_id}: {error}")
|
|
||||||
return None, error or "Model lookup failed"
|
|
||||||
|
|
||||||
data = self._normalize_payload(lookup_payload)
|
|
||||||
version_block = data.get("version")
|
|
||||||
if not isinstance(version_block, dict):
|
|
||||||
logger.warning(f"CivArchive lookup for version {version_id} returned no version block")
|
|
||||||
return None, "Model not found"
|
|
||||||
|
|
||||||
actual_version_id = version_block.get("id")
|
|
||||||
actual_model_id = version_block.get("modelId")
|
|
||||||
if actual_version_id is None or actual_model_id is None:
|
|
||||||
logger.warning(
|
|
||||||
"CivArchive lookup for version %s missing ids (modelId=%s, versionId=%s)",
|
|
||||||
version_id,
|
|
||||||
actual_model_id,
|
|
||||||
actual_version_id,
|
|
||||||
)
|
|
||||||
return None, "Model not found"
|
|
||||||
|
|
||||||
version = await self.get_model_version(actual_model_id, actual_version_id)
|
|
||||||
if version is None:
|
|
||||||
return None, "Model not found"
|
|
||||||
|
|
||||||
return version, None
|
|
||||||
|
|
||||||
except Exception as exc:
|
|
||||||
logger.error(f"Error resolving CivArchive model version info for {version_id}: {exc}")
|
|
||||||
return None, "Model lookup failed"
|
|
||||||
|
|
||||||
async def get_model_by_url(self, url) -> Optional[Dict]:
|
async def get_model_by_url(self, url) -> Optional[Dict]:
|
||||||
"""Get specific model version by parsing CivArchive HTML page (legacy method)
|
"""Get specific model version by parsing CivArchive HTML page (legacy method)
|
||||||
|
|||||||
Reference in New Issue
Block a user