aboutsummaryrefslogtreecommitdiff
path: root/app/ui/hub.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/ui/hub.py')
-rw-r--r--app/ui/hub.py22
1 files changed, 16 insertions, 6 deletions
diff --git a/app/ui/hub.py b/app/ui/hub.py
index 230def3..7ac938e 100644
--- a/app/ui/hub.py
+++ b/app/ui/hub.py
@@ -58,6 +58,7 @@ from converter.clients import (
BACKEND_AUDIOCPP,
BACKEND_FASTER,
BACKEND_QWEN,
+ LANGUAGE_CHOICES,
QWEN3_TTS_SPEAKERS,
audiocpp_entry_voice_capability,
normalize_language,
@@ -908,22 +909,29 @@ def _field_value(fields, key: str, default=None):
return default
+# Dim hint shown while editing a Language field (Settings and Generate
+# audiobooks): which languages a model accepts varies by backend/model.
+_LANGUAGE_EDIT_HINT = ["Check model documentation for supported languages."]
+
+
def _common_fields() -> list:
"""Field dicts for output format, language, speed, single-file, debug.
The single-file field is hidden for m4b (always a single file with
embedded chapter markers), so its "visible" callable reads the live
output-format value from the field list. The per-run Language field
- mirrors the CLI's --language and is hidden for faster entries (the
- faster server owns the language).
+ mirrors the CLI's --language (a static audio.cpp-menu picker) and is
+ hidden for faster entries (the faster server owns the language).
"""
fmt_default = config.AUDIO_FORMAT \
if config.AUDIO_FORMAT in AUDIO_FORMATS else AUDIO_FORMATS[0]
return [
{"key": "output_format", "label": "Output format", "kind": "choice",
"value": fmt_default, "choices": list(AUDIO_FORMATS)},
- {"key": "language", "label": "Language", "kind": "text",
- "value": config.LANGUAGE, "validate": _validate_language,
+ {"key": "language", "label": "Language", "kind": "choice",
+ "value": config.LANGUAGE, "choices": list(LANGUAGE_CHOICES),
+ "help": _LANGUAGE_EDIT_HINT,
+ "validate": _validate_language,
"visible": lambda fs: not str(_field_value(fs, "backend") or "")
.startswith("faster")},
{"key": "speed", "label": "Speed", "kind": "text", "value": "1.0",
@@ -1437,8 +1445,10 @@ def _settings_fields() -> list:
{"key": "audio_bitrate", "label": "Audio bitrate", "kind": "text",
"value": config.AUDIO_BITRATE,
"validate": _validate_bitrate},
- {"key": "language", "label": "Language", "kind": "text",
- "value": config.LANGUAGE, "validate": _validate_language},
+ {"key": "language", "label": "Default Language", "kind": "choice",
+ "value": config.LANGUAGE, "choices": list(LANGUAGE_CHOICES),
+ "help": _LANGUAGE_EDIT_HINT,
+ "validate": _validate_language},
{"key": "chunk_size", "label": "Chunk size (words)", "kind": "text",
"value": str(config.CHUNK_SIZE), "validate": _validate_chunk_size},
{"key": "stop_and_exit", "label": "Default stop server and exit",