feat: Enhance speaker analysis with gender inference and update related tests

This commit is contained in:
JB
2025-10-08 07:09:12 -07:00
parent 3b07df9708
commit 1bae37477b
9 changed files with 361 additions and 155 deletions
+3 -3
View File
@@ -332,7 +332,7 @@ def _apply_prepare_form(
"text": chapter.get("text", ""),
"enabled": enabled,
}
entry["characters"] = len(entry["text"])
entry["characters"] = calculate_text_length(entry["text"])
if enabled:
if voice_selection.startswith("voice:"):
@@ -359,7 +359,7 @@ def _apply_prepare_form(
else:
entry["voice_formula"] = formula_input
entry["resolved_voice"] = formula_input
selected_total += len(entry["text"] or "")
selected_total += entry["characters"]
overrides.append(entry)
pending.chapters[index] = dict(entry)
@@ -1299,7 +1299,7 @@ def enqueue_job() -> ResponseReturnValue:
"index": index,
"title": chapter.title,
"text": chapter.text,
"characters": len(chapter.text),
"characters": calculate_text_length(chapter.text),
"enabled": enabled,
}
)