aboutsummaryrefslogtreecommitdiff
path: root/app/ui/hub.py
diff options
context:
space:
mode:
authorhistoria <historiavg@proton.me>2026-09-02 20:33:44 -0400
committerhistoria <historiavg@proton.me>2026-09-02 20:33:44 -0400
commitdfce6c38a9a67ea2760fedae73ee9f5989d52f13 (patch)
tree4212258c63908201c9720d016f0ea86d7f209aae /app/ui/hub.py
parent08e702700303f9bb5767f02a337b8b34be410df9 (diff)
downloadtts-audiobook-generator-dfce6c38a9a67ea2760fedae73ee9f5989d52f13.tar.gz
feat: add model and voice labels to generate audiobooks status tui
Diffstat (limited to 'app/ui/hub.py')
-rw-r--r--app/ui/hub.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/app/ui/hub.py b/app/ui/hub.py
index e883996..13f17e7 100644
--- a/app/ui/hub.py
+++ b/app/ui/hub.py
@@ -1924,6 +1924,8 @@ def _audiocpp_fields(stdscr, api_url: Optional[str] = None,
kwargs["model_voices"] = {
model_id: all_voice_for(model_id, picked)
for model_id in kwargs["model_ids"]}
+ kwargs["run_model"] = f"All ({len(kwargs['model_ids'])} models)"
+ kwargs["run_voice"] = picked
skipped = non_narrating_models()
if skipped:
kwargs["run_notice"] = \
@@ -1934,6 +1936,8 @@ def _audiocpp_fields(stdscr, api_url: Optional[str] = None,
# a server-side preset otherwise); the client resolves which it is.
kwargs["model_id"] = model_id
kwargs["voice"] = result[prefix + "audiocpp_voice"] or None
+ kwargs["run_model"] = model_id
+ kwargs["run_voice"] = result[prefix + "audiocpp_voice"] or ""
return ("convert", BACKEND_AUDIOCPP, kwargs)
return fields, mapper
@@ -2039,6 +2043,13 @@ def _qwen_fields(remote_modes: Optional[list] = None,
if mode == "clone":
clone = str(result[prefix + "clone"] or "").strip() or None
kwargs = {"clone": clone, **_common_kwargs(result)}
+ # The run view's Model/Voice rows: the mode word the form's Model
+ # menu picked, the speaker on CustomVoice, and the reference
+ # .wav's file name on Base (the voice is described on VoiceDesign,
+ # so no voice row there).
+ kwargs["run_model"] = dict(mode_keys)[mode]
+ kwargs["run_voice"] = result[prefix + "speaker"] if mode == "custom" \
+ else (Path(clone).stem if clone else "")
if mode == "custom":
kwargs["voice"] = result[prefix + "speaker"]
if mode == "design":
@@ -2108,6 +2119,8 @@ def _faster_fields(stdscr, api_url: Optional[str] = None,
"voice": voice or None,
**_common_kwargs(result),
}
+ # faster has no model pick — the run view shows the voice only.
+ kwargs["run_voice"] = voice or ""
if api_url is not None:
kwargs["api_url"] = api_url
return ("convert", BACKEND_FASTER, kwargs)
@@ -2335,6 +2348,13 @@ def _sglomni_fields(stdscr, api_url: Optional[str] = None,
kwargs["voice"] = pick
else:
kwargs["instructions"] = result[prefix + "instructions"]
+ # The run view's Model/Voice rows: the catalog label, and the
+ # pick — or the clone reference's file name (the .wav stems,
+ # like the narrator tags). Design models describe the voice,
+ # so they get no voice row.
+ kwargs["run_model"] = entry.label
+ kwargs["run_voice"] = Path(kwargs["clone"]).stem \
+ if kwargs.get("clone") else pick
if api_url is not None:
kwargs["api_url"] = api_url
return ("convert", BACKEND_SGLOMNI, kwargs)
@@ -2674,6 +2694,10 @@ def _prepare_run_config(backend: str, kwargs: dict
# A pre-flight warning the convert form recorded (e.g. the "All" run's
# skipped non-narrating models): shown under the progress panel.
run_notice = str(kwargs.pop("run_notice", "") or "")
+ # The run view's Model/Voice header rows (display-only picks the form
+ # mappers recorded; not converter kwargs).
+ run_model = str(kwargs.pop("run_model", "") or "")
+ run_voice = str(kwargs.pop("run_voice", "") or "")
# book_files/planned travel on the dedicated RunConfig fields; keeping
# them in kwargs too would collide with convert()'s named parameters.
book_files = kwargs.pop("book_files", None) or []
@@ -2688,6 +2712,7 @@ def _prepare_run_config(backend: str, kwargs: dict
planned=planned,
server_url=api_url, server_identity=identity,
log_path=log_path, notice=run_notice,
+ model_label=run_model, voice_label=run_voice,
stop_and_exit=stop_and_exit)
status = next((s for s in detect_all(refresh=True)
@@ -2746,6 +2771,7 @@ def _prepare_run_config(backend: str, kwargs: dict
restart_first=bool(restart_name) and spec is not None,
log_path=log_path,
notice="; ".join(n for n in notices if n),
+ model_label=run_model, voice_label=run_voice,
stop_and_exit=stop_and_exit)