From 5c9346c32ce2420772f967a5080fda776d5f24d5 Mon Sep 17 00:00:00 2001 From: Ivandro Jao Date: Mon, 21 Oct 2024 19:33:08 +0100 Subject: [PATCH] Refactor logging and transcript check in WhisperAudioToText Simplify the logic by reordering logging updates and transcript checks. This removes redundant `UpdateLog` and `SeLogger.WhisperInfo` calls, streamlining the flow and maintaining the existing functionality. Signed-off-by: Ivandro Jao --- src/ui/Forms/AudioToText/WhisperAudioToText.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/ui/Forms/AudioToText/WhisperAudioToText.cs b/src/ui/Forms/AudioToText/WhisperAudioToText.cs index 38eea6877..6d91c847b 100644 --- a/src/ui/Forms/AudioToText/WhisperAudioToText.cs +++ b/src/ui/Forms/AudioToText/WhisperAudioToText.cs @@ -560,17 +560,12 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText Configuration.Settings.Tools.WhisperPostProcessingFixShortDuration, Configuration.Settings.Tools.WhisperPostProcessingSplitLines); + UpdateLog(); + SeLogger.WhisperInfo(textBoxLog.Text); if (transcript == null || transcript.Paragraphs.Count == 0) { - UpdateLog(); - SeLogger.WhisperInfo(textBoxLog.Text); IncompleteModelName = comboBoxModels.Text; } - else - { - UpdateLog(); - SeLogger.WhisperInfo(textBoxLog.Text); - } timer1.Stop();