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 <Ivandrofly@gmail.com>
This commit is contained in:
Ivandro Jao 2024-10-21 19:33:08 +01:00
parent 5fd050a1b8
commit 5c9346c32c

View File

@ -560,17 +560,12 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
Configuration.Settings.Tools.WhisperPostProcessingFixShortDuration, Configuration.Settings.Tools.WhisperPostProcessingFixShortDuration,
Configuration.Settings.Tools.WhisperPostProcessingSplitLines); Configuration.Settings.Tools.WhisperPostProcessingSplitLines);
UpdateLog();
SeLogger.WhisperInfo(textBoxLog.Text);
if (transcript == null || transcript.Paragraphs.Count == 0) if (transcript == null || transcript.Paragraphs.Count == 0)
{ {
UpdateLog();
SeLogger.WhisperInfo(textBoxLog.Text);
IncompleteModelName = comboBoxModels.Text; IncompleteModelName = comboBoxModels.Text;
} }
else
{
UpdateLog();
SeLogger.WhisperInfo(textBoxLog.Text);
}
timer1.Stop(); timer1.Stop();