diff options
Diffstat (limited to 'MediaBrowser.Controller')
| -rw-r--r-- | MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs | 15 | ||||
| -rw-r--r-- | MediaBrowser.Controller/IServerApplicationHost.cs | 5 |
2 files changed, 20 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs b/MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs index 48316499a..900cc6cb5 100644 --- a/MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs +++ b/MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs @@ -1,3 +1,4 @@ +using System; using Microsoft.Extensions.Configuration; namespace MediaBrowser.Controller.Extensions @@ -8,6 +9,11 @@ namespace MediaBrowser.Controller.Extensions public static class ConfigurationExtensions { /// <summary> + /// The key for a setting that indicates whether the application should host static web content. + /// </summary> + public const string NoWebContentKey = "nowebcontent"; + + /// <summary> /// The key for the FFmpeg probe size option. /// </summary> public const string FfmpegProbeSizeKey = "FFmpeg:probesize"; @@ -23,6 +29,15 @@ namespace MediaBrowser.Controller.Extensions public const string PlaylistsAllowDuplicatesKey = "playlists:allowDuplicates"; /// <summary> + /// Gets a value indicating whether the application should not host static web content from the <see cref="IConfiguration"/>. + /// </summary> + /// <param name="configuration">The configuration to retrieve the value from.</param> + /// <returns>The parsed config value.</returns> + /// <exception cref="FormatException">The config value is not a valid bool string. See <see cref="bool.Parse(string)"/>.</exception> + public static bool NoWebContent(this IConfiguration configuration) + => configuration.GetValue<bool>(NoWebContentKey); + + /// <summary> /// Gets the FFmpeg probe size from the <see cref="IConfiguration" />. /// </summary> /// <param name="configuration">The configuration to read the setting from.</param> diff --git a/MediaBrowser.Controller/IServerApplicationHost.cs b/MediaBrowser.Controller/IServerApplicationHost.cs index 25f0905eb..608ffc61c 100644 --- a/MediaBrowser.Controller/IServerApplicationHost.cs +++ b/MediaBrowser.Controller/IServerApplicationHost.cs @@ -82,6 +82,11 @@ namespace MediaBrowser.Controller /// <returns>The local API URL.</returns> string GetLocalApiUrl(IPAddress address); + /// <summary> + /// Open a URL in an external browser window. + /// </summary> + /// <param name="url">The URL to open.</param> + /// <exception cref="NotSupportedException"><see cref="CanLaunchWebBrowser"/> is false.</exception> void LaunchUrl(string url); void EnableLoopback(string appName); |
