Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix FFmpeg downloaders fetching >4 year old FFmpeg builds on Windows #1205

Merged
merged 2 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions TwitchDownloaderCLI/Modes/FfmpegHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions TwitchDownloaderWPF/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
Loading