aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/IServerApplicationHost.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller/IServerApplicationHost.cs')
-rw-r--r--MediaBrowser.Controller/IServerApplicationHost.cs66
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);
}
}