f
This commit is contained in:
@@ -467,7 +467,7 @@ def get_local_storage_path(config: Dict[str, Any]) -> Optional[Path]:
|
||||
"""Get local storage path from config.
|
||||
|
||||
Supports multiple formats:
|
||||
- New: config["store"]["folder"]["*"]["path"] (picks first folder store if 'default' is missing)
|
||||
- New: config["store"]["folder"]["any_name"]["path"]
|
||||
- Old: config["storage"]["local"]["path"]
|
||||
- Old: config["Local"]["path"]
|
||||
|
||||
@@ -477,19 +477,11 @@ def get_local_storage_path(config: Dict[str, Any]) -> Optional[Path]:
|
||||
Returns:
|
||||
Path object if found, None otherwise
|
||||
"""
|
||||
# Try new format first: store.folder.default.path
|
||||
# Try new format: iterate all folder stores and use the first valid path found.
|
||||
store = config.get("store", {})
|
||||
if isinstance(store, dict):
|
||||
folder_config = store.get("folder", {})
|
||||
if isinstance(folder_config, dict):
|
||||
# 1. Try "default" specifically
|
||||
default_config = folder_config.get("default", {})
|
||||
if isinstance(default_config, dict):
|
||||
path_str = default_config.get("path")
|
||||
if path_str:
|
||||
return expand_path(path_str)
|
||||
|
||||
# 2. If no "default", pick the first one that has a path
|
||||
for name, inst_cfg in folder_config.items():
|
||||
if isinstance(inst_cfg, dict):
|
||||
p = inst_cfg.get("path") or inst_cfg.get("PATH")
|
||||
|
||||
Reference in New Issue
Block a user