Prevent server from starting if the ffmpeg path is invalid (#12463)

This commit is contained in:
gnattu
2024-08-29 02:43:37 +08:00
committed by GitHub
parent 8c3f3c503b
commit 6c8ca30f7f
6 changed files with 43 additions and 73 deletions

View File

@@ -29,6 +29,11 @@ namespace MediaBrowser.Controller.Extensions
/// </summary>
public const string FfmpegProbeSizeKey = "FFmpeg:probesize";
/// <summary>
/// The key for the skipping FFmpeg validation.
/// </summary>
public const string FfmpegSkipValidationKey = "FFmpeg:novalidation";
/// <summary>
/// The key for the FFmpeg analyze duration option.
/// </summary>
@@ -89,6 +94,14 @@ namespace MediaBrowser.Controller.Extensions
public static string? GetFFmpegAnalyzeDuration(this IConfiguration configuration)
=> configuration[FfmpegAnalyzeDurationKey];
/// <summary>
/// Gets a value indicating whether the server should validate FFmpeg during startup.
/// </summary>
/// <param name="configuration">The configuration to read the setting from.</param>
/// <returns><c>true</c> if the server should validate FFmpeg during startup, otherwise <c>false</c>.</returns>
public static bool GetFFmpegSkipValidation(this IConfiguration configuration)
=> configuration.GetValue<bool>(FfmpegSkipValidationKey);
/// <summary>
/// Gets a value indicating whether playlists should allow duplicate entries from the <see cref="IConfiguration"/>.
/// </summary>