mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-21 21:22:11 -03:00
Refactor early access checks in recipe parsers
- Updated the early access condition checks in RecipeFormatParser, StandardMetadataParser, and A1111MetadataParser to use `get` method for improved readability and safety. - Ensured consistent handling of early access status across different parser classes.
This commit is contained in:
@@ -112,7 +112,7 @@ class RecipeFormatParser(RecipeMetadataParser):
|
||||
civitai_info = await civitai_client.get_model_version_info(lora['modelVersionId'])
|
||||
if civitai_info and civitai_info.get("error") != "Model not found":
|
||||
# Check if this is an early access lora
|
||||
if 'earlyAccessEndsAt' in civitai_info:
|
||||
if civitai_info.get('earlyAccessEndsAt'):
|
||||
# Convert earlyAccessEndsAt to a human-readable date
|
||||
early_access_date = civitai_info.get('earlyAccessEndsAt', '')
|
||||
lora_entry['isEarlyAccess'] = True
|
||||
@@ -227,7 +227,7 @@ class StandardMetadataParser(RecipeMetadataParser):
|
||||
# Check if this LoRA exists locally by SHA256 hash
|
||||
if civitai_info and civitai_info.get("error") != "Model not found":
|
||||
# Check if this is an early access lora
|
||||
if 'earlyAccessEndsAt' in civitai_info:
|
||||
if civitai_info.get('earlyAccessEndsAt'):
|
||||
# Convert earlyAccessEndsAt to a human-readable date
|
||||
early_access_date = civitai_info.get('earlyAccessEndsAt', '')
|
||||
lora_entry['isEarlyAccess'] = True
|
||||
@@ -442,7 +442,7 @@ class A1111MetadataParser(RecipeMetadataParser):
|
||||
civitai_info = await civitai_client.get_model_by_hash(hash_value)
|
||||
if civitai_info and civitai_info.get("error") != "Model not found":
|
||||
# Check if this is an early access lora
|
||||
if 'earlyAccessEndsAt' in civitai_info:
|
||||
if civitai_info.get('earlyAccessEndsAt'):
|
||||
# Convert earlyAccessEndsAt to a human-readable date
|
||||
early_access_date = civitai_info.get('earlyAccessEndsAt', '')
|
||||
lora_entry['isEarlyAccess'] = True
|
||||
|
||||
Reference in New Issue
Block a user