diff options
| author | historia <historiavg@proton.me> | 2026-08-24 00:41:52 -0400 |
|---|---|---|
| committer | historia <historiavg@proton.me> | 2026-08-24 00:41:52 -0400 |
| commit | 194c63e4d11e6de9792a736a7b99788f1db78741 (patch) | |
| tree | 0c7eca8bee825b8d5c32f4c64e1d87da793caedb /backends/faster.py | |
| parent | 5bfbdcb5765fd4eb57d13c67169bb3c2706ead75 (diff) | |
| download | tts-audiobook-generator-194c63e4d11e6de9792a736a7b99788f1db78741.tar.gz | |
feat: running process detection, menu gating
Diffstat (limited to 'backends/faster.py')
| -rwxr-xr-x | backends/faster.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/backends/faster.py b/backends/faster.py index 4a2cc6f..71be050 100755 --- a/backends/faster.py +++ b/backends/faster.py @@ -25,8 +25,8 @@ from typing import List, Optional sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) -import tui -from backends import BackendStatus, ModifyAction +from ui import tui +from backends import BackendStatus, ConfigureAction from backends import common from backends.common import TTS_ROOT, find_wav_files, normalize_dir_arg from converter import config @@ -335,6 +335,7 @@ def detect() -> BackendStatus: cloned = _is_cloned() voices_json = _checkout() / "voices.json" configured = installed and cloned and voices_json.exists() + running = common.server_running(config.FASTER_API_URL) details: List[str] = [] details.append("pip: installed" if installed else "not installed — run setup to pip install") @@ -348,12 +349,12 @@ def detect() -> BackendStatus: f"--voices {voices_json} --port {_config_port()}") return BackendStatus("faster", "faster-qwen3-tts", installed=installed and cloned, - configured=configured, details=details, - launch_hint=launch) + configured=configured, running=running, + details=details, launch_hint=launch) def _run_voices_only_tui() -> int: - """Rebuild voices.json via the TUI (the "modify" action). + """Rebuild voices.json via the TUI (the "configure" action). Runs the same wizard but skips the pip/clone prerequisites so it goes straight to picking the .wav directory and writing voices.json. @@ -364,9 +365,9 @@ def _run_voices_only_tui() -> int: return run_tui(args) -modify_actions: List[ModifyAction] = [ - ModifyAction("Rebuild voices.json", _run_voices_only_tui), - ModifyAction("Reconfigure faster-qwen3-tts", run_tui), +configure_actions: List[ConfigureAction] = [ + ConfigureAction("Rebuild voices.json", _run_voices_only_tui), + ConfigureAction("Reconfigure faster-qwen3-tts", run_tui), ] |
