aboutsummaryrefslogtreecommitdiff
path: root/app/ui/hub.py
diff options
context:
space:
mode:
authorhistoria <historiavg@proton.me>2026-08-25 20:48:51 -0400
committerhistoria <historiavg@proton.me>2026-08-25 20:48:51 -0400
commitd453d88d1d40c5e54af07ceb89c8c18d09cfdb0e (patch)
treeaaf99573d0380c57174ca1ec5437e09e26fece37 /app/ui/hub.py
parentf3f7bb98e4bc969a17fba71294177819fbbbd070 (diff)
downloadtts-audiobook-generator-d453d88d1d40c5e54af07ceb89c8c18d09cfdb0e.tar.gz
feat: default save and exit server setting
Diffstat (limited to 'app/ui/hub.py')
-rw-r--r--app/ui/hub.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/ui/hub.py b/app/ui/hub.py
index 1eef63b..cad9a9d 100644
--- a/app/ui/hub.py
+++ b/app/ui/hub.py
@@ -366,7 +366,7 @@ class _Hub:
if not ok:
return tui.Wizard.BACK
if self._run_conversion(cmd[1], cmd[2]):
- # "Stop server and exit after generating" was on: returning
+ # "Stop server and exit" was on: returning
# None ends the wizard stack (the whole TUI).
return None
return tui.Wizard.BACK
@@ -850,8 +850,8 @@ def _common_fields() -> list:
"kind": "bool", "value": False,
"visible": lambda fs: _field_value(fs, "output_format") != "m4b"},
{"key": "debug", "label": "Debug", "kind": "bool", "value": False},
- {"key": "stop_and_exit", "label": "Stop server and exit after "
- "generating", "kind": "bool", "value": True},
+ {"key": "stop_and_exit", "label": "Stop server and exit",
+ "kind": "bool", "value": config.STOP_SERVER_AND_EXIT},
]
@@ -1203,6 +1203,8 @@ def _settings_fields() -> list:
"value": config.LANGUAGE, "validate": _validate_language},
{"key": "chunk_size", "label": "Chunk size (words)", "kind": "text",
"value": str(config.CHUNK_SIZE), "validate": _validate_chunk_size},
+ {"key": "stop_and_exit", "label": "Default stop server and exit",
+ "kind": "bool", "value": config.STOP_SERVER_AND_EXIT},
{"key": "unload_models", "label": "Unload models", "kind": "bool",
"value": config.AUDIOCPP_UNLOAD_MODELS,
"note": "audio.cpp: Unload previously-loaded models before converting to prevent VRAM exhaustion."},
@@ -1330,6 +1332,7 @@ def _apply_settings(values: dict) -> None:
"AUDIO_BITRATE": bitrate,
"LANGUAGE": normalize_language(values["language"]),
"CHUNK_SIZE": chunk_size,
+ "STOP_SERVER_AND_EXIT": bool(values["stop_and_exit"]),
"AUDIOCPP_UNLOAD_MODELS": bool(values["unload_models"]),
"QWEN_API_URL": common.url_with_port(
config.QWEN_API_URL, ports["qwen_custom_port"]),