diff options
| author | historia <historiavg@proton.me> | 2026-08-26 18:18:21 -0400 |
|---|---|---|
| committer | historia <historiavg@proton.me> | 2026-08-26 18:18:21 -0400 |
| commit | 544486a374cd5cae7acce1302648d8dad079db48 (patch) | |
| tree | 5987cdb6790844252ec655465eacea8ae526e3a8 /app/backends/audiocpp/wizard.py | |
| parent | 6ccb6d443d2fb871b43d96ea61a95bc3e6a92355 (diff) | |
| download | tts-audiobook-generator-544486a374cd5cae7acce1302648d8dad079db48.tar.gz | |
fix: default directory when choosing voices in tui
Diffstat (limited to 'app/backends/audiocpp/wizard.py')
| -rw-r--r-- | app/backends/audiocpp/wizard.py | 16 |
1 files changed, 9 insertions, 7 deletions
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 |
