mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-21 21:22:11 -03:00
refactor: Simplify handling of base model path mappings and download path templates by removing unnecessary JSON.stringify calls
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
@@ -183,16 +182,6 @@ class MiscRoutes:
|
||||
if old_path != value:
|
||||
logger.info(f"Example images path changed to {value} - server restart required")
|
||||
|
||||
# Special handling for base_model_path_mappings - parse JSON string
|
||||
if (key == 'base_model_path_mappings' or key == 'download_path_templates') and value:
|
||||
try:
|
||||
value = json.loads(value)
|
||||
except json.JSONDecodeError:
|
||||
return web.json_response({
|
||||
'success': False,
|
||||
'error': f"Invalid JSON format for base_model_path_mappings: {value}"
|
||||
})
|
||||
|
||||
# Save to settings
|
||||
settings.set(key, value)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user