diff --git a/TwitchDownloaderCLI/Modes/FfmpegHandler.cs b/TwitchDownloaderCLI/Modes/FfmpegHandler.cs index d2a192c6..04f9e0dc 100644 --- a/TwitchDownloaderCLI/Modes/FfmpegHandler.cs +++ b/TwitchDownloaderCLI/Modes/FfmpegHandler.cs @@ -37,16 +37,15 @@ private static void DownloadFfmpeg(ITaskProgress progress) using var progressHandler = new XabeProgressHandler(progress); + FFmpegDownloader.GetLatestVersion(FFmpegVersion.Official, progressHandler).GetAwaiter().GetResult(); + + Console.WriteLine(); + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { - FFmpegDownloader.GetLatestVersion(FFmpegVersion.Full, progressHandler).GetAwaiter().GetResult(); return; } - FFmpegDownloader.GetLatestVersion(FFmpegVersion.Official, progressHandler).GetAwaiter().GetResult(); - - Console.WriteLine(); - try { var ffmpegFileInfo = new UnixFileInfo("ffmpeg") diff --git a/TwitchDownloaderWPF/MainWindow.xaml.cs b/TwitchDownloaderWPF/MainWindow.xaml.cs index d99f7f5b..05876f92 100644 --- a/TwitchDownloaderWPF/MainWindow.xaml.cs +++ b/TwitchDownloaderWPF/MainWindow.xaml.cs @@ -99,12 +99,12 @@ private async void Window_Loaded(object sender, RoutedEventArgs e) #endif // TODO: extract FFmpeg handling to a dedicated service - if (!File.Exists("ffmpeg.exe")) + if (!File.Exists("ffmpeg.exe") || File.GetLastWriteTime("ffmpeg.exe") < DateTime.Now - TimeSpan.FromDays(365)) { var oldTitle = Title; try { - await FFmpegDownloader.GetLatestVersion(FFmpegVersion.Full, new FfmpegDownloadProgress()); + await FFmpegDownloader.GetLatestVersion(FFmpegVersion.Official, new FfmpegDownloadProgress()); // Flash the window to signify that FFmpeg has been downloaded FlashTaskbarIconIfNotForeground(TimeSpan.FromSeconds(3));