mirror of
https://github.com/StuffAnThings/qbit_manage.git
synced 2025-10-30 07:58:16 +08:00
feat(config): add automatic config directory detection for existing yaml files
- Update get_default_config_dir to check for existing YAML files in addition to sample files
This commit is contained in:
parent
2f15302a96
commit
19aa766094
3 changed files with 4 additions and 3 deletions
2
VERSION
2
VERSION
|
|
@ -1 +1 @@
|
|||
4.5.6-develop8
|
||||
4.5.6-develop9
|
||||
|
|
|
|||
|
|
@ -290,7 +290,8 @@ def get_default_config_dir(config_hint: str = None) -> str:
|
|||
|
||||
# 3) Fallbacks
|
||||
has_yaml_sample = glob.glob(os.path.join("/config", "*.yml.sample")) or glob.glob(os.path.join("/config", "*.yaml.sample"))
|
||||
if os.path.isdir("/config") and has_yaml_sample:
|
||||
has_yaml = glob.glob(os.path.join("/config", "*.yml")) or glob.glob(os.path.join("/config", "*.yaml"))
|
||||
if os.path.isdir("/config") and (has_yaml_sample or has_yaml):
|
||||
return "/config"
|
||||
return str(_platform_config_base())
|
||||
|
||||
|
|
|
|||
|
|
@ -887,7 +887,7 @@ class WebAPI:
|
|||
logger.trace(f"Data to write: {data}")
|
||||
|
||||
# Convert !ENV strings back to EnvStr objects
|
||||
processed_data = self._convert_env_strings_to_objects(data)
|
||||
processed_data = self._restore_env_objects(data)
|
||||
|
||||
# Use the custom YAML class with format preservation
|
||||
if config_path.exists():
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue