2019-10-26 20:53:53 +00:00
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Extensions
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Configuration extensions for <c>MediaBrowser.Controller</c>.
|
|
|
|
/// </summary>
|
|
|
|
public static class ConfigurationExtensions
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// The key for the FFmpeg probe size option.
|
|
|
|
/// </summary>
|
2019-12-12 15:57:16 +00:00
|
|
|
public const string FfmpegProbeSizeKey = "FFmpeg:probesize";
|
2019-10-26 20:53:53 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2020-03-13 22:11:59 +00:00
|
|
|
/// The key for the FFmpeg analyze duration option.
|
2019-10-26 20:53:53 +00:00
|
|
|
/// </summary>
|
2019-12-12 15:57:16 +00:00
|
|
|
public const string FfmpegAnalyzeDurationKey = "FFmpeg:analyzeduration";
|
2019-10-26 20:53:53 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2020-03-13 22:11:59 +00:00
|
|
|
/// The key for a setting that indicates whether playlists should allow duplicate entries.
|
2019-10-26 20:53:53 +00:00
|
|
|
/// </summary>
|
2020-03-13 22:11:59 +00:00
|
|
|
public const string PlaylistsAllowDuplicatesKey = "playlists:allowDuplicates";
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the FFmpeg probe size from the <see cref="IConfiguration" />.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">The configuration to read the setting from.</param>
|
2019-10-26 20:53:53 +00:00
|
|
|
/// <returns>The FFmpeg probe size option.</returns>
|
2019-12-12 16:02:42 +00:00
|
|
|
public static string GetFFmpegProbeSize(this IConfiguration configuration)
|
2019-10-26 20:53:53 +00:00
|
|
|
=> configuration[FfmpegProbeSizeKey];
|
|
|
|
|
|
|
|
/// <summary>
|
2020-03-13 22:11:59 +00:00
|
|
|
/// Gets the FFmpeg analyze duration from the <see cref="IConfiguration" />.
|
2019-10-26 20:53:53 +00:00
|
|
|
/// </summary>
|
2020-03-13 22:11:59 +00:00
|
|
|
/// <param name="configuration">The configuration to read the setting from.</param>
|
|
|
|
/// <returns>The FFmpeg analyze duration option.</returns>
|
2019-12-12 16:02:42 +00:00
|
|
|
public static string GetFFmpegAnalyzeDuration(this IConfiguration configuration)
|
2019-11-25 11:12:48 +00:00
|
|
|
=> configuration[FfmpegAnalyzeDurationKey];
|
2020-03-13 22:11:59 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets a value indicating whether playlists should allow duplicate entries from the <see cref="IConfiguration"/>.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="configuration">The configuration to read the setting from.</param>
|
|
|
|
/// <returns>True if playlists should allow duplicates, otherwise false.</returns>
|
|
|
|
public static bool DoPlaylistsAllowDuplicates(this IConfiguration configuration)
|
|
|
|
=> configuration.GetValue<bool>(PlaylistsAllowDuplicatesKey);
|
2019-10-26 20:53:53 +00:00
|
|
|
}
|
|
|
|
}
|