From abae1cc76a83c52ab4b980cfcf4730b97199f057 Mon Sep 17 00:00:00 2001 From: azhuge233 <17763056+azhuge233@users.noreply.github.com> Date: Thu, 22 Jun 2023 15:49:21 +0800 Subject: [PATCH] Fix wrong ffmpeg download location. --- ConsoleWhisper/Module/FileHelper.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ConsoleWhisper/Module/FileHelper.cs b/ConsoleWhisper/Module/FileHelper.cs index 764994a..4b68e76 100644 --- a/ConsoleWhisper/Module/FileHelper.cs +++ b/ConsoleWhisper/Module/FileHelper.cs @@ -60,7 +60,7 @@ internal static class FileHelper { internal static async Task DownloadFFmpegandModel(Argument arg) { try { FFmpeg.SetExecutablesPath(AppDirectory); - + var tasks = new List() { Task.Run(DownloadFFmpeg), Task.Run(() => DownloadModel(arg.ModelType)) @@ -138,6 +138,8 @@ internal static class FileHelper { #region downloader private static async Task DownloadFFmpeg() { + FFmpeg.SetExecutablesPath(AppDirectory); + if (!FFmpegExists()) { Output.Warn($"FFmpeg not found, start downloading."); await FFmpegDownloader.GetLatestVersion(FFmpegVersion.Official); @@ -154,10 +156,13 @@ internal static class FileHelper { #region Check if necessary file exists private static bool ModelExists(string modelFilename) { + Output.Success(ModelDirectory); return File.Exists(Path.Combine(ModelDirectory, modelFilename)); } private static bool FFmpegExists() { + Output.Success(FFmpegLocation); + Output.Success(FFprobeLocation); return File.Exists(FFmpegLocation) && File.Exists(FFprobeLocation); } #endregion