aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs
diff options
context:
space:
mode:
authorClaus Vium <cvium@users.noreply.github.com>2020-09-03 14:54:00 +0200
committerGitHub <noreply@github.com>2020-09-03 14:54:00 +0200
commit2f9b4825550c97d1432033958d7a016d8775dff9 (patch)
tree0b896551a3f0d955122190ff6217e6bbd4e16dda /MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs
parentc7b5bc55a1ac985c46b918e4b6208ea1f4ae0b2f (diff)
parent8c28824c8878e409ca426e4860dc3f05521f39b8 (diff)
Merge branch 'master' into master
Diffstat (limited to 'MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs')
-rw-r--r--MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs26
1 files changed, 26 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs b/MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs
index c2932cc4c..4c2209b67 100644
--- a/MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs
+++ b/MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs
@@ -34,6 +34,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 +75,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];
}
}