Merge pull request #2601 from mark-monteiro/support-running-without-web-content

Support Running Server Without Web Content
This commit is contained in:
Vasily
2020-04-01 23:38:43 +03:00
committed by GitHub
15 changed files with 236 additions and 105 deletions

View File

@@ -1,3 +1,4 @@
using System;
using Microsoft.Extensions.Configuration;
namespace MediaBrowser.Controller.Extensions
@@ -7,6 +8,11 @@ namespace MediaBrowser.Controller.Extensions
/// </summary>
public static class ConfigurationExtensions
{
/// <summary>
/// The key for a setting that indicates whether the application should host web client content.
/// </summary>
public const string HostWebClientKey = "hostwebclient";
/// <summary>
/// The key for the FFmpeg probe size option.
/// </summary>
@@ -22,6 +28,15 @@ namespace MediaBrowser.Controller.Extensions
/// </summary>
public const string PlaylistsAllowDuplicatesKey = "playlists:allowDuplicates";
/// <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>
/// <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 HostWebClient(this IConfiguration configuration)
=> configuration.GetValue<bool>(HostWebClientKey);
/// <summary>
/// Gets the FFmpeg probe size from the <see cref="IConfiguration" />.
/// </summary>

View File

@@ -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);