diff options
| author | Joshua M. Boniface <joshua@boniface.me> | 2021-08-18 02:46:59 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-18 02:46:59 -0400 |
| commit | 72d3f7020ad80ce1a53eeae8c5d57abeb22a4679 (patch) | |
| tree | dd43e663838cdc7d99a4af565523df58ae23c856 /MediaBrowser.Controller/IServerApplicationHost.cs | |
| parent | 7aef0fce444e6d8e06386553ec7ea1401a01bbb1 (diff) | |
| parent | e5cbafdb6b47377052e0d638908ef96e30a997d6 (diff) | |
Merge branch 'master' into patch-2
Diffstat (limited to 'MediaBrowser.Controller/IServerApplicationHost.cs')
| -rw-r--r-- | MediaBrowser.Controller/IServerApplicationHost.cs | 66 |
1 files changed, 31 insertions, 35 deletions
diff --git a/MediaBrowser.Controller/IServerApplicationHost.cs b/MediaBrowser.Controller/IServerApplicationHost.cs index 39b896c0f..753c18bc7 100644 --- a/MediaBrowser.Controller/IServerApplicationHost.cs +++ b/MediaBrowser.Controller/IServerApplicationHost.cs @@ -1,10 +1,10 @@ +#nullable disable + #pragma warning disable CS1591 using System; using System.Collections.Generic; using System.Net; -using System.Threading; -using System.Threading.Tasks; using MediaBrowser.Common; using MediaBrowser.Model.System; using Microsoft.AspNetCore.Http; @@ -16,9 +16,7 @@ namespace MediaBrowser.Controller /// </summary> public interface IServerApplicationHost : IApplicationHost { - event EventHandler HasUpdateAvailableChanged; - - IServiceProvider ServiceProvider { get; } + bool CoreStartupHasCompleted { get; } bool CanLaunchWebBrowser { get; } @@ -40,54 +38,55 @@ namespace MediaBrowser.Controller bool ListenWithHttps { get; } /// <summary> - /// Gets a value indicating whether this instance has update available. - /// </summary> - /// <value><c>true</c> if this instance has update available; otherwise, <c>false</c>.</value> - bool HasUpdateAvailable { get; } - - /// <summary> /// Gets the name of the friendly. /// </summary> /// <value>The name of the friendly.</value> string FriendlyName { get; } /// <summary> + /// Gets the configured published server url. + /// </summary> + string PublishedServerUrl { get; } + + /// <summary> /// Gets the system info. /// </summary> + /// <param name="source">The originator of the request.</param> /// <returns>SystemInfo.</returns> - Task<SystemInfo> GetSystemInfo(CancellationToken cancellationToken); + SystemInfo GetSystemInfo(IPAddress source); - Task<PublicSystemInfo> GetPublicSystemInfo(CancellationToken cancellationToken); + PublicSystemInfo GetPublicSystemInfo(IPAddress address); /// <summary> - /// Gets all the local IP addresses of this API instance. Each address is validated by sending a 'ping' request - /// to the API that should exist at the address. + /// Gets a URL specific for the request. /// </summary> - /// <param name="cancellationToken">A cancellation token that can be used to cancel the task.</param> - /// <returns>A list containing all the local IP addresses of the server.</returns> - Task<List<IPAddress>> GetLocalIpAddresses(CancellationToken cancellationToken); + /// <param name="request">The <see cref="HttpRequest"/> instance.</param> + /// <param name="port">Optional port number.</param> + /// <returns>An accessible URL.</returns> + string GetSmartApiUrl(HttpRequest request, int? port = null); /// <summary> - /// Gets a local (LAN) URL that can be used to access the API. The hostname used is the first valid configured - /// IP address that can be found via <see cref="GetLocalIpAddresses"/>. HTTPS will be preferred when available. + /// Gets a URL specific for the request. /// </summary> - /// <param name="cancellationToken">A cancellation token that can be used to cancel the task.</param> - /// <returns>The server URL.</returns> - Task<string> GetLocalApiUrl(CancellationToken cancellationToken); + /// <param name="remoteAddr">The remote <see cref="IPAddress"/> of the connection.</param> + /// <param name="port">Optional port number.</param> + /// <returns>An accessible URL.</returns> + string GetSmartApiUrl(IPAddress remoteAddr, int? port = null); /// <summary> - /// Gets a localhost URL that can be used to access the API using the loop-back IP address (127.0.0.1) - /// over HTTP (not HTTPS). + /// Gets a URL specific for the request. /// </summary> - /// <returns>The API URL.</returns> - string GetLoopbackHttpApiUrl(); + /// <param name="hostname">The hostname used in the connection.</param> + /// <param name="port">Optional port number.</param> + /// <returns>An accessible URL.</returns> + string GetSmartApiUrl(string hostname, int? port = null); /// <summary> - /// Gets a local (LAN) URL that can be used to access the API. HTTPS will be preferred when available. + /// Gets a localhost URL that can be used to access the API using the loop-back IP address. + /// over HTTP (not HTTPS). /// </summary> - /// <param name="address">The IP address to use as the hostname in the URL.</param> /// <returns>The API URL.</returns> - string GetLocalApiUrl(IPAddress address); + string GetLoopbackHttpApiUrl(); /// <summary> /// Gets a local (LAN) URL that can be used to access the API. @@ -103,7 +102,7 @@ namespace MediaBrowser.Controller /// preferring the HTTPS port, if available. /// </param> /// <returns>The API URL.</returns> - string GetLocalApiUrl(ReadOnlySpan<char> hostname, string scheme = null, int? port = null); + string GetLocalApiUrl(string hostname, string scheme = null, int? port = null); /// <summary> /// Open a URL in an external browser window. @@ -112,13 +111,10 @@ namespace MediaBrowser.Controller /// <exception cref="NotSupportedException"><see cref="CanLaunchWebBrowser"/> is false.</exception> void LaunchUrl(string url); - void EnableLoopback(string appName); - IEnumerable<WakeOnLanInfo> GetWakeOnLanInfo(); string ExpandVirtualPath(string path); - string ReverseVirtualPath(string path); - Task ExecuteHttpHandlerAsync(HttpContext context, Func<Task> next); + string ReverseVirtualPath(string path); } } |
