mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-25 15:15:44 -03:00
Update preview URL handling in load_metadata function to reflect model location changes. See #113
This commit is contained in:
@@ -207,11 +207,11 @@ async def load_metadata(file_path: str, model_class: Type[BaseModelMetadata] = L
|
|||||||
data['preview_url'] = new_preview_url
|
data['preview_url'] = new_preview_url
|
||||||
needs_update = True
|
needs_update = True
|
||||||
else:
|
else:
|
||||||
# Compare preview paths without extensions
|
if stored_path_base != current_path_base:
|
||||||
stored_preview_base = os.path.splitext(preview_url)[0]
|
# If model location changed, update preview path by replacing old path with new path
|
||||||
current_preview_base = os.path.splitext(normalize_path(preview_url))[0]
|
preview_file = os.path.basename(preview_url)
|
||||||
if stored_preview_base != current_preview_base:
|
new_preview_url = os.path.join(os.path.dirname(file_path), preview_file)
|
||||||
data['preview_url'] = normalize_path(preview_url)
|
data['preview_url'] = normalize_path(new_preview_url)
|
||||||
needs_update = True
|
needs_update = True
|
||||||
|
|
||||||
# Ensure all fields are present
|
# Ensure all fields are present
|
||||||
|
|||||||
Reference in New Issue
Block a user