mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-23 22:22:11 -03:00
feat: add open settings location endpoint
- Add `open_settings_location` method to `FileSystemHandler` to open OS file explorer at settings file location - Register new POST route `/api/lm/settings/open-location` for settings file access - Inject `SettingsManager` dependency into `FileSystemHandler` constructor - Add cross-platform support for Windows, macOS, and Linux file explorers - Include error handling for missing settings files and system exceptions
This commit is contained in:
@@ -883,6 +883,7 @@ class SettingsManager:
|
||||
|
||||
if os.path.abspath(previous_path) != os.path.abspath(target_path):
|
||||
self._copy_model_cache_directory(previous_dir, target_dir)
|
||||
logger.info("Switching settings file to: %s", target_path)
|
||||
|
||||
self._pending_portable_switch = {"other_path": other_path}
|
||||
self.settings_file = target_path
|
||||
@@ -929,7 +930,12 @@ class SettingsManager:
|
||||
and os.path.abspath(source_cache_dir) != os.path.abspath(target_cache_dir)
|
||||
):
|
||||
try:
|
||||
shutil.copytree(source_cache_dir, target_cache_dir, dirs_exist_ok=True)
|
||||
shutil.copytree(
|
||||
source_cache_dir,
|
||||
target_cache_dir,
|
||||
dirs_exist_ok=True,
|
||||
ignore=shutil.ignore_patterns("*.sqlite-shm", "*.sqlite-wal"),
|
||||
)
|
||||
except Exception as exc:
|
||||
logger.warning(
|
||||
"Failed to copy model_cache directory from %s to %s: %s",
|
||||
|
||||
Reference in New Issue
Block a user