From 544486a374cd5cae7acce1302648d8dad079db48 Mon Sep 17 00:00:00 2001 From: historia Date: Wed, 26 Aug 2026 18:18:21 -0400 Subject: fix: default directory when choosing voices in tui --- app/backends/audiocpp/wizard.py | 16 +++++++++------- app/backends/faster.py | 2 +- app/backends/qwen.py | 9 ++++----- 3 files changed, 14 insertions(+), 13 deletions(-) (limited to 'app/backends') diff --git a/app/backends/audiocpp/wizard.py b/app/backends/audiocpp/wizard.py index 2034827..831ae3d 100644 --- a/app/backends/audiocpp/wizard.py +++ b/app/backends/audiocpp/wizard.py @@ -14,9 +14,7 @@ from backends import common from backends.common import ( APP_DIR, PROMPT_TEXT_FILENAME, - TTS_ROOT, VOICES_DIR, - detect_wav_dir, find_wav_files, read_prompt_text, resolve_wav_dir_arg, @@ -336,7 +334,8 @@ def _wizard(stdscr, args: argparse.Namespace, parser: argparse.ArgumentParser picked = tui.checkbox_tree( stdscr, "Select TTS models to host", tree_families, expand_all=args.all_packages, - back_value=_GO_BACK, checked=checked_set) + back_value=_GO_BACK, checked=checked_set, + start_on_buttons=True) if picked is _GO_BACK: return tui.Wizard.BACK chosen: Dict[str, List[dict]] = {} @@ -452,14 +451,17 @@ def _wizard(stdscr, args: argparse.Namespace, parser: argparse.ArgumentParser s["backend"] = None # decided by the form s["build"] = None - # Clone-voice directory seed: the project voices/ dir (detected), - # or the voice_dir recorded by the server.json being modified. + # Clone-voice directory seed: the voice_dir recorded by the + # server.json being modified, else the project voices/ dir (the + # same default the --wavs flag documents). No auto-detection: the + # field must never start blank. wav_start = None if s["include_clone"]: - wav_start = detect_wav_dir(s["audiocpp_dir"], TTS_ROOT) if isinstance(s["existing_voice_dir"], str) \ and s["existing_voice_dir"]: wav_start = Path(s["existing_voice_dir"]) + else: + wav_start = VOICES_DIR s["wav_dir"] = wav_start fields: List[dict] = [] @@ -572,7 +574,7 @@ def _wizard(stdscr, args: argparse.Namespace, parser: argparse.ArgumentParser result = tui.form( stdscr, "Configure audio.cpp", fields, - buttons=("Continue!", "Cancel"), + buttons=("Continue", "Cancel"), start_on_buttons=False, back_value=tui.Wizard.BACK) if result is tui.Wizard.BACK: return tui.Wizard.BACK diff --git a/app/backends/faster.py b/app/backends/faster.py index 57e6752..60ddddf 100755 --- a/app/backends/faster.py +++ b/app/backends/faster.py @@ -288,7 +288,7 @@ def _wizard(stdscr, args: argparse.Namespace) -> Optional[dict]: result = tui.form( stdscr, "Set up faster-qwen3-tts", fields, - buttons=("Continue!", "Cancel"), + buttons=("Continue", "Cancel"), start_on_buttons=False, back_value=_GO_BACK) if result is _GO_BACK: return None diff --git a/app/backends/qwen.py b/app/backends/qwen.py index 5f45580..592b0eb 100644 --- a/app/backends/qwen.py +++ b/app/backends/qwen.py @@ -33,7 +33,7 @@ from backends import ( ) from converter import config from converter.clients import QWEN3_TTS_SPEAKERS -from ui import taskview, tui +from ui import taskview QWEN_PIP_PKG = "qwen-tts" QWEN_CUSTOMVOICE_MODEL = "Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice" @@ -107,14 +107,13 @@ def setup_screen(stdscr) -> int: """Run the setup on an existing curses screen (the hub's). There are no questions: settings are computed up front and the install - runs inside the TUI task view on this same screen (skipped entirely - when nothing needs installing). Returns 0 always — the flow cannot be - aborted, so Esc/Ctrl-C never short-circuits it. + runs inside the TUI task view on this same screen — skipped entirely + (a silent no-op) when nothing needs installing. Returns 0 always — + the flow cannot be aborted, so Esc/Ctrl-C never short-circuits it. """ args = build_parser().parse_args([]) settings = _wizard(stdscr, args) if not settings["do_install"]: - tui.flash(stdscr, "qwen-tts is already installed.", "ok") return 0 return taskview.run_steps(stdscr, "Setting up qwen-tts", _execute_steps(settings)) -- cgit v1.2.3