Skip to content

Conversation

micah686
Copy link
Contributor

@micah686 micah686 commented Aug 5, 2025

Added support for timeouts.
Also made unix downloads (.net core 8 or above) set unix permissions

Comment on lines 246 to 254
{
if(OSHelper.IsWindows)return;
#if NET8_0_OR_GREATER
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
File.SetUnixFileMode(filename, UnixFileMode.UserExecute | UnixFileMode.UserRead | UnixFileMode.UserWrite);
#else
throw new PlatformNotSupportedException("Setting Unix permissions is not supported on this platform.");
#endif
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • checking with the OSHelper.GetOSVersion() is probably enough.
  • File.SetUnixFileMode() is available in .NET 7+

Comment on lines 193 to 201
public static async Task DownloadFFmpeg(string directoryPath = "", int timeoutSeconds = 60 * 5)
{
await FFDownloader(directoryPath, FFmpegApi.BinaryType.FFmpeg);
await FFDownloader(directoryPath, binary: FFmpegApi.BinaryType.FFmpeg);
}

public static async Task DownloadFFprobe(string directoryPath = "")
public static async Task DownloadFFprobe(string directoryPath = "", int timeoutSeconds = 60 * 5)
{
await FFDownloader(directoryPath, FFmpegApi.BinaryType.FFprobe);
await FFDownloader(directoryPath, binary:FFmpegApi.BinaryType.FFprobe);
}
Copy link

@IPdotSetAF IPdotSetAF Aug 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

timeoutSeconds is not used in these functions

Copy link

@IPdotSetAF IPdotSetAF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests are failing due to changing timeout while other tests are still running.
maybe a global timeout setting is better option (with setter function maybe)

@micah686
Copy link
Contributor Author

micah686 commented Aug 6, 2025

tests are failing due to changing timeout while other tests are still running. maybe a global timeout setting is better option (with setter function maybe)
Yeah, sorry about that. Did the fix in a rush yesterday.
I've added a TimeoutSeconds property to the Utils .
Also, I've verified that the tests pass now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants