|
|
@ -1067,9 +1067,9 @@ namespace Emby.Server.Implementations
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the system status.
|
|
|
|
/// Gets the system status.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="source">Where this request originated.</param>
|
|
|
|
/// <param name="request">Where this request originated.</param>
|
|
|
|
/// <returns>SystemInfo.</returns>
|
|
|
|
/// <returns>SystemInfo.</returns>
|
|
|
|
public SystemInfo GetSystemInfo(IPAddress source)
|
|
|
|
public SystemInfo GetSystemInfo(HttpRequest request)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return new SystemInfo
|
|
|
|
return new SystemInfo
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1091,7 +1091,7 @@ namespace Emby.Server.Implementations
|
|
|
|
CanLaunchWebBrowser = CanLaunchWebBrowser,
|
|
|
|
CanLaunchWebBrowser = CanLaunchWebBrowser,
|
|
|
|
TranscodingTempPath = ConfigurationManager.GetTranscodePath(),
|
|
|
|
TranscodingTempPath = ConfigurationManager.GetTranscodePath(),
|
|
|
|
ServerName = FriendlyName,
|
|
|
|
ServerName = FriendlyName,
|
|
|
|
LocalAddress = GetSmartApiUrl(source),
|
|
|
|
LocalAddress = GetSmartApiUrl(request),
|
|
|
|
SupportsLibraryMonitor = true,
|
|
|
|
SupportsLibraryMonitor = true,
|
|
|
|
SystemArchitecture = RuntimeInformation.OSArchitecture,
|
|
|
|
SystemArchitecture = RuntimeInformation.OSArchitecture,
|
|
|
|
PackageName = _startupOptions.PackageName
|
|
|
|
PackageName = _startupOptions.PackageName
|
|
|
@ -1103,7 +1103,7 @@ namespace Emby.Server.Implementations
|
|
|
|
.Select(i => new WakeOnLanInfo(i))
|
|
|
|
.Select(i => new WakeOnLanInfo(i))
|
|
|
|
.ToList();
|
|
|
|
.ToList();
|
|
|
|
|
|
|
|
|
|
|
|
public PublicSystemInfo GetPublicSystemInfo(IPAddress address)
|
|
|
|
public PublicSystemInfo GetPublicSystemInfo(HttpRequest request)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return new PublicSystemInfo
|
|
|
|
return new PublicSystemInfo
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1112,7 +1112,7 @@ namespace Emby.Server.Implementations
|
|
|
|
Id = SystemId,
|
|
|
|
Id = SystemId,
|
|
|
|
OperatingSystem = MediaBrowser.Common.System.OperatingSystem.Id.ToString(),
|
|
|
|
OperatingSystem = MediaBrowser.Common.System.OperatingSystem.Id.ToString(),
|
|
|
|
ServerName = FriendlyName,
|
|
|
|
ServerName = FriendlyName,
|
|
|
|
LocalAddress = GetSmartApiUrl(address),
|
|
|
|
LocalAddress = GetSmartApiUrl(request),
|
|
|
|
StartupWizardCompleted = ConfigurationManager.CommonConfiguration.IsStartupWizardCompleted
|
|
|
|
StartupWizardCompleted = ConfigurationManager.CommonConfiguration.IsStartupWizardCompleted
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1140,6 +1140,18 @@ namespace Emby.Server.Implementations
|
|
|
|
/// <inheritdoc/>
|
|
|
|
/// <inheritdoc/>
|
|
|
|
public string GetSmartApiUrl(HttpRequest request, int? port = null)
|
|
|
|
public string GetSmartApiUrl(HttpRequest request, int? port = null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
// Return the host in the HTTP request as the API url
|
|
|
|
|
|
|
|
if (ConfigurationManager.GetNetworkConfiguration().EnablePublishedServerUriByRequest)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int? requestPort = request.Host.Port;
|
|
|
|
|
|
|
|
if ((requestPort == 80 && string.Equals(request.Scheme, "http", StringComparison.OrdinalIgnoreCase)) || (requestPort == 443 && string.Equals(request.Scheme, "https", StringComparison.OrdinalIgnoreCase)))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
requestPort = -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return GetLocalApiUrl(request.Host.Host, request.Scheme, requestPort);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Published server ends with a /
|
|
|
|
// Published server ends with a /
|
|
|
|
if (!string.IsNullOrEmpty(PublishedServerUrl))
|
|
|
|
if (!string.IsNullOrEmpty(PublishedServerUrl))
|
|
|
|
{
|
|
|
|
{
|
|
|
|