diff options
| author | Patrick Barron <18354464+barronpm@users.noreply.github.com> | 2020-09-03 19:03:08 +0000 |
|---|---|---|
| committer | Patrick Barron <barronpm@gmail.com> | 2020-09-03 15:15:43 -0400 |
| commit | d81430270732591a5a66c9656bf841f46bed6f49 (patch) | |
| tree | c97b2b255d1d2d266939e28b41c12b1cc3bad08f /MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs | |
| parent | 229a5d9e0bf99f9c6f741f654f1dbe0a7f975872 (diff) | |
| parent | 53703566b5e1239bbab308031d94df34a4d168aa (diff) | |
Merge branch 'master' into scoped-displaypreferences
Diffstat (limited to 'MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs')
| -rw-r--r-- | MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs b/MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs index c2932cc4c..f9285c768 100644 --- a/MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs +++ b/MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs @@ -9,6 +9,12 @@ namespace MediaBrowser.Controller.Extensions public static class ConfigurationExtensions { /// <summary> + /// The key for a setting that specifies the default redirect path + /// to use for requests where the URL base prefix is invalid or missing.. + /// </summary> + public const string DefaultRedirectKey = "DefaultRedirectPath"; + + /// <summary> /// The key for a setting that indicates whether the application should host web client content. /// </summary> public const string HostWebClientKey = "hostwebclient"; @@ -34,6 +40,16 @@ namespace MediaBrowser.Controller.Extensions public const string PlaylistsAllowDuplicatesKey = "playlists:allowDuplicates"; /// <summary> + /// The key for a setting that indicates whether kestrel should bind to a unix socket. + /// </summary> + public const string BindToUnixSocketKey = "kestrel:socket"; + + /// <summary> + /// The key for the unix socket path. + /// </summary> + public const string UnixSocketPathKey = "kestrel:socketPath"; + + /// <summary> /// Gets a value indicating whether the application should host static web content from the <see cref="IConfiguration"/>. /// </summary> /// <param name="configuration">The configuration to retrieve the value from.</param> @@ -65,5 +81,21 @@ namespace MediaBrowser.Controller.Extensions /// <returns>True if playlists should allow duplicates, otherwise false.</returns> public static bool DoPlaylistsAllowDuplicates(this IConfiguration configuration) => configuration.GetValue<bool>(PlaylistsAllowDuplicatesKey); + + /// <summary> + /// Gets a value indicating whether kestrel should bind to a unix socket from the <see cref="IConfiguration" />. + /// </summary> + /// <param name="configuration">The configuration to read the setting from.</param> + /// <returns><c>true</c> if kestrel should bind to a unix socket, otherwise <c>false</c>.</returns> + public static bool UseUnixSocket(this IConfiguration configuration) + => configuration.GetValue<bool>(BindToUnixSocketKey); + + /// <summary> + /// Gets the path for the unix socket from the <see cref="IConfiguration" />. + /// </summary> + /// <param name="configuration">The configuration to read the setting from.</param> + /// <returns>The unix socket path.</returns> + public static string GetUnixSocketPath(this IConfiguration configuration) + => configuration[UnixSocketPathKey]; } } |
