Fix running "Faster-Whisper-XXL" without "Faster-Whisper" - thx shanedk :)

Work on #8645
This commit is contained in:
Nikolaj Olsson 2024-07-20 15:54:17 +02:00
parent 884cda5297
commit 97e3e47b50
3 changed files with 5 additions and 4 deletions

View File

@ -12,12 +12,12 @@
* Update French translation - thx Pierre
* Update Greek translation - thx PMitsakis
* Allower for larger files via drop to list view - thx Jim
* FIXED:
* Fix crash in TTML IMSC 1.1 - thx Louie
* Fix Romanian translation version number - thx MediaExpres
* Fix UI burn-in window spacing/width/height - thx Hafran420
* Fix crash in "Whisper Audio to text" if no audio - thx morrellaberdeen
* Fix running "Faster-Whisper-XXL" without "Faster-Whisper" - thx shanedk
4.0.7 (8th July 2024)

View File

@ -1,6 +1,7 @@
using Nikse.SubtitleEdit.Core.Common;
using System;
using System.IO;
using Nikse.SubtitleEdit.Core.NetflixQualityCheck;
namespace Nikse.SubtitleEdit.Core.AudioToText
{
@ -166,12 +167,12 @@ namespace Nikse.SubtitleEdit.Core.AudioToText
var location = Configuration.Settings.Tools.WhisperCtranslate2Location;
if (!string.IsNullOrEmpty(location))
{
if (location.EndsWith("whisper-faster.exe", StringComparison.InvariantCultureIgnoreCase) && File.Exists(location))
if (location.EndsWith(GetExecutableFileName(whisperChoice), StringComparison.InvariantCultureIgnoreCase) && File.Exists(location))
{
return Path.GetDirectoryName(location);
}
if (Directory.Exists(location) && File.Exists(Path.Combine(location, "whisper-faster.exe")))
if (Directory.Exists(location) && File.Exists(Path.Combine(location, GetExecutableFileName(whisperChoice))))
{
return location;
}

View File

@ -398,7 +398,7 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
if (comboBoxWhisperEngine.Text == WhisperChoice.PurfviewFasterWhisper ||
comboBoxWhisperEngine.Text == WhisperChoice.PurfviewFasterWhisperXXL)
{
var fileName = WhisperHelper.GetWhisperPathAndFileName(WhisperChoice.PurfviewFasterWhisper);
var fileName = WhisperHelper.GetWhisperPathAndFileName(comboBoxWhisperEngine.Text);
if (!File.Exists(fileName))
{
if (MessageBox.Show(string.Format(LanguageSettings.Current.Settings.DownloadX, comboBoxWhisperEngine.Text), "Subtitle Edit", MessageBoxButtons.YesNoCancel) == DialogResult.Yes)