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/audiocpp.py | |
| parent | 5bfbdcb5765fd4eb57d13c67169bb3c2706ead75 (diff) | |
| download | tts-audiobook-generator-194c63e4d11e6de9792a736a7b99788f1db78741.tar.gz | |
feat: running process detection, menu gating
Diffstat (limited to 'backends/audiocpp.py')
| -rwxr-xr-x | backends/audiocpp.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/backends/audiocpp.py b/backends/audiocpp.py index b401366..57636a7 100755 --- a/backends/audiocpp.py +++ b/backends/audiocpp.py @@ -41,8 +41,8 @@ from typing import Callable, Dict, List, Optional, Set, Tuple # Allow running directly (python backends/audiocpp.py) from any cwd. 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 ( CONFIG_PATH, @@ -1645,11 +1645,14 @@ def build_parser() -> argparse.ArgumentParser: def detect() -> BackendStatus: """Detect how far audio.cpp is set up, plus the command to start it.""" checkout = find_local_checkout() + # Probe the server first: it may be running externally even with no + # local checkout, and the status table should show that. + running = common.server_running(config.AUDIOCPP_API_URL) details: List[str] = [] launch = "" if checkout is None: return BackendStatus("audiocpp", "audio.cpp", installed=False, - configured=False, + configured=False, running=running, details=["not cloned — run setup to clone " "./audio.cpp"]) details.append(f"checkout: {checkout}") @@ -1670,13 +1673,13 @@ def detect() -> BackendStatus: else: details.append("no server.json — run setup to configure models") return BackendStatus("audiocpp", "audio.cpp", installed=built, - configured=configured, details=details, - launch_hint=launch) + configured=configured, running=running, + details=details, launch_hint=launch) -modify_actions: List[ModifyAction] = [ - ModifyAction("Reconfigure audio.cpp (models, voices, server.json)", - run_tui), +configure_actions: List[ConfigureAction] = [ + ConfigureAction("Reconfigure audio.cpp (models, voices, server.json)", + run_tui), ] |
