From 8968efcc8e9562f1c740fe7bab3f111d5826e02c Mon Sep 17 00:00:00 2001 From: ScrubN <72096833+ScrubN@users.noreply.github.com> Date: Fri, 30 Aug 2024 17:26:47 -0400 Subject: [PATCH 1/2] Do not fetch extremely outdated Zenaroe FFmpeg builds --- TwitchDownloaderCLI/Modes/FfmpegHandler.cs | 9 ++++----- TwitchDownloaderWPF/MainWindow.xaml.cs | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) 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..bc7179d3 100644 --- a/TwitchDownloaderWPF/MainWindow.xaml.cs +++ b/TwitchDownloaderWPF/MainWindow.xaml.cs @@ -104,7 +104,7 @@ private async void Window_Loaded(object sender, RoutedEventArgs e) 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)); From 54f27d76d13dc59fa51fd109bb8d5aa4d085c315 Mon Sep 17 00:00:00 2001 From: ScrubN <72096833+ScrubN@users.noreply.github.com> Date: Fri, 30 Aug 2024 17:28:40 -0400 Subject: [PATCH 2/2] Redownload WPF FFmpeg if the file is over 1 year old --- TwitchDownloaderWPF/MainWindow.xaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TwitchDownloaderWPF/MainWindow.xaml.cs b/TwitchDownloaderWPF/MainWindow.xaml.cs index bc7179d3..05876f92 100644 --- a/TwitchDownloaderWPF/MainWindow.xaml.cs +++ b/TwitchDownloaderWPF/MainWindow.xaml.cs @@ -99,7 +99,7 @@ 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