using System; using Microsoft.Extensions.Configuration; namespace MediaBrowser.Controller.Extensions { /// /// Configuration extensions for MediaBrowser.Controller. /// public static class ConfigurationExtensions { /// /// The key for a setting that indicates whether the application should host static web content. /// public const string NoWebContentKey = "nowebcontent"; /// /// The key for the FFmpeg probe size option. /// public const string FfmpegProbeSizeKey = "FFmpeg:probesize"; /// /// The key for the FFmpeg analyze duration option. /// public const string FfmpegAnalyzeDurationKey = "FFmpeg:analyzeduration"; /// /// The key for a setting that indicates whether playlists should allow duplicate entries. /// public const string PlaylistsAllowDuplicatesKey = "playlists:allowDuplicates"; /// /// Gets a value indicating whether the application should not host static web content from the . /// /// The configuration to retrieve the value from. /// The parsed config value. /// The config value is not a valid bool string. See . public static bool NoWebContent(this IConfiguration configuration) => configuration.GetValue(NoWebContentKey); /// /// Gets the FFmpeg probe size from the . /// /// The configuration to read the setting from. /// The FFmpeg probe size option. public static string GetFFmpegProbeSize(this IConfiguration configuration) => configuration[FfmpegProbeSizeKey]; /// /// Gets the FFmpeg analyze duration from the . /// /// The configuration to read the setting from. /// The FFmpeg analyze duration option. public static string GetFFmpegAnalyzeDuration(this IConfiguration configuration) => configuration[FfmpegAnalyzeDurationKey]; /// /// Gets a value indicating whether playlists should allow duplicate entries from the . /// /// The configuration to read the setting from. /// True if playlists should allow duplicates, otherwise false. public static bool DoPlaylistsAllowDuplicates(this IConfiguration configuration) => configuration.GetValue(PlaylistsAllowDuplicatesKey); } }