Fixed post-processing for chinese (#628)

This commit is contained in:
CJ Pais 2026-01-20 10:14:38 +08:00 committed by GitHub
parent cc129e9105
commit c45df96065
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -340,15 +340,16 @@ impl ShortcutAction for TranscribeAction {
if let Some(converted_text) =
maybe_convert_chinese_variant(&settings, &transcription).await
{
final_text = converted_text.clone();
post_processed_text = Some(converted_text);
final_text = converted_text;
}
// Then apply regular post-processing if enabled
else if let Some(processed_text) =
maybe_post_process_transcription(&settings, &transcription).await
// Uses final_text which may already have Chinese conversion applied
if let Some(processed_text) =
maybe_post_process_transcription(&settings, &final_text).await
{
final_text = processed_text.clone();
post_processed_text = Some(processed_text);
post_processed_text = Some(processed_text.clone());
final_text = processed_text;
// Get the prompt that was used
if let Some(prompt_id) = &settings.post_process_selected_prompt_id {
@ -360,6 +361,9 @@ impl ShortcutAction for TranscribeAction {
post_process_prompt = Some(prompt.prompt.clone());
}
}
} else if final_text != transcription {
// Chinese conversion was applied but no LLM post-processing
post_processed_text = Some(final_text.clone());
}
// Save to history with post-processed text and prompt