|
@@ -103,7 +103,6 @@ using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Logging;
|
|
using Microsoft.Extensions.Logging;
|
|
using Prometheus.DotNetRuntime;
|
|
using Prometheus.DotNetRuntime;
|
|
-using OperatingSystem = MediaBrowser.Common.System.OperatingSystem;
|
|
|
|
using WebSocketManager = Emby.Server.Implementations.HttpServer.WebSocketManager;
|
|
using WebSocketManager = Emby.Server.Implementations.HttpServer.WebSocketManager;
|
|
|
|
|
|
namespace Emby.Server.Implementations
|
|
namespace Emby.Server.Implementations
|
|
@@ -150,13 +149,7 @@ namespace Emby.Server.Implementations
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
- if (OperatingSystem.Id == OperatingSystemId.Windows
|
|
|
|
- || OperatingSystem.Id == OperatingSystemId.Darwin)
|
|
|
|
- {
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return false;
|
|
|
|
|
|
+ return OperatingSystem.IsWindows() || OperatingSystem.IsMacOS();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -721,7 +714,7 @@ namespace Emby.Server.Implementations
|
|
|
|
|
|
logger.LogInformation("Environment Variables: {EnvVars}", relevantEnvVars);
|
|
logger.LogInformation("Environment Variables: {EnvVars}", relevantEnvVars);
|
|
logger.LogInformation("Arguments: {Args}", commandLineArgs);
|
|
logger.LogInformation("Arguments: {Args}", commandLineArgs);
|
|
- logger.LogInformation("Operating system: {OS}", OperatingSystem.Name);
|
|
|
|
|
|
+ logger.LogInformation("Operating system: {OS}", MediaBrowser.Common.System.OperatingSystem.Name);
|
|
logger.LogInformation("Architecture: {Architecture}", RuntimeInformation.OSArchitecture);
|
|
logger.LogInformation("Architecture: {Architecture}", RuntimeInformation.OSArchitecture);
|
|
logger.LogInformation("64-Bit Process: {Is64Bit}", Environment.Is64BitProcess);
|
|
logger.LogInformation("64-Bit Process: {Is64Bit}", Environment.Is64BitProcess);
|
|
logger.LogInformation("User Interactive: {IsUserInteractive}", Environment.UserInteractive);
|
|
logger.LogInformation("User Interactive: {IsUserInteractive}", Environment.UserInteractive);
|
|
@@ -1098,11 +1091,10 @@ namespace Emby.Server.Implementations
|
|
ItemsByNamePath = ApplicationPaths.InternalMetadataPath,
|
|
ItemsByNamePath = ApplicationPaths.InternalMetadataPath,
|
|
InternalMetadataPath = ApplicationPaths.InternalMetadataPath,
|
|
InternalMetadataPath = ApplicationPaths.InternalMetadataPath,
|
|
CachePath = ApplicationPaths.CachePath,
|
|
CachePath = ApplicationPaths.CachePath,
|
|
- OperatingSystem = OperatingSystem.Id.ToString(),
|
|
|
|
- OperatingSystemDisplayName = OperatingSystem.Name,
|
|
|
|
|
|
+ OperatingSystem = MediaBrowser.Common.System.OperatingSystem.Id.ToString(),
|
|
|
|
+ OperatingSystemDisplayName = MediaBrowser.Common.System.OperatingSystem.Name,
|
|
CanSelfRestart = CanSelfRestart,
|
|
CanSelfRestart = CanSelfRestart,
|
|
CanLaunchWebBrowser = CanLaunchWebBrowser,
|
|
CanLaunchWebBrowser = CanLaunchWebBrowser,
|
|
- HasUpdateAvailable = HasUpdateAvailable,
|
|
|
|
TranscodingTempPath = ConfigurationManager.GetTranscodePath(),
|
|
TranscodingTempPath = ConfigurationManager.GetTranscodePath(),
|
|
ServerName = FriendlyName,
|
|
ServerName = FriendlyName,
|
|
LocalAddress = GetSmartApiUrl(source),
|
|
LocalAddress = GetSmartApiUrl(source),
|
|
@@ -1118,16 +1110,16 @@ namespace Emby.Server.Implementations
|
|
.Select(i => new WakeOnLanInfo(i))
|
|
.Select(i => new WakeOnLanInfo(i))
|
|
.ToList();
|
|
.ToList();
|
|
|
|
|
|
- public PublicSystemInfo GetPublicSystemInfo(IPAddress source)
|
|
|
|
|
|
+ public PublicSystemInfo GetPublicSystemInfo(IPAddress address)
|
|
{
|
|
{
|
|
return new PublicSystemInfo
|
|
return new PublicSystemInfo
|
|
{
|
|
{
|
|
Version = ApplicationVersionString,
|
|
Version = ApplicationVersionString,
|
|
ProductName = ApplicationProductName,
|
|
ProductName = ApplicationProductName,
|
|
Id = SystemId,
|
|
Id = SystemId,
|
|
- OperatingSystem = OperatingSystem.Id.ToString(),
|
|
|
|
|
|
+ OperatingSystem = MediaBrowser.Common.System.OperatingSystem.Id.ToString(),
|
|
ServerName = FriendlyName,
|
|
ServerName = FriendlyName,
|
|
- LocalAddress = GetSmartApiUrl(source),
|
|
|
|
|
|
+ LocalAddress = GetSmartApiUrl(address),
|
|
StartupWizardCompleted = ConfigurationManager.CommonConfiguration.IsStartupWizardCompleted
|
|
StartupWizardCompleted = ConfigurationManager.CommonConfiguration.IsStartupWizardCompleted
|
|
};
|
|
};
|
|
}
|
|
}
|
|
@@ -1136,7 +1128,7 @@ namespace Emby.Server.Implementations
|
|
public bool ListenWithHttps => Certificate != null && ConfigurationManager.GetNetworkConfiguration().EnableHttps;
|
|
public bool ListenWithHttps => Certificate != null && ConfigurationManager.GetNetworkConfiguration().EnableHttps;
|
|
|
|
|
|
/// <inheritdoc/>
|
|
/// <inheritdoc/>
|
|
- public string GetSmartApiUrl(IPAddress ipAddress, int? port = null)
|
|
|
|
|
|
+ public string GetSmartApiUrl(IPAddress remoteAddr, int? port = null)
|
|
{
|
|
{
|
|
// Published server ends with a /
|
|
// Published server ends with a /
|
|
if (!string.IsNullOrEmpty(PublishedServerUrl))
|
|
if (!string.IsNullOrEmpty(PublishedServerUrl))
|
|
@@ -1145,7 +1137,7 @@ namespace Emby.Server.Implementations
|
|
return PublishedServerUrl.Trim('/');
|
|
return PublishedServerUrl.Trim('/');
|
|
}
|
|
}
|
|
|
|
|
|
- string smart = NetManager.GetBindInterface(ipAddress, out port);
|
|
|
|
|
|
+ string smart = NetManager.GetBindInterface(remoteAddr, out port);
|
|
// If the smartAPI doesn't start with http then treat it as a host or ip.
|
|
// If the smartAPI doesn't start with http then treat it as a host or ip.
|
|
if (smart.StartsWith("http", StringComparison.OrdinalIgnoreCase))
|
|
if (smart.StartsWith("http", StringComparison.OrdinalIgnoreCase))
|
|
{
|
|
{
|
|
@@ -1208,14 +1200,14 @@ namespace Emby.Server.Implementations
|
|
}
|
|
}
|
|
|
|
|
|
/// <inheritdoc/>
|
|
/// <inheritdoc/>
|
|
- public string GetLocalApiUrl(string host, string scheme = null, int? port = null)
|
|
|
|
|
|
+ public string GetLocalApiUrl(string hostname, string scheme = null, int? port = null)
|
|
{
|
|
{
|
|
// NOTE: If no BaseUrl is set then UriBuilder appends a trailing slash, but if there is no BaseUrl it does
|
|
// NOTE: If no BaseUrl is set then UriBuilder appends a trailing slash, but if there is no BaseUrl it does
|
|
// not. For consistency, always trim the trailing slash.
|
|
// not. For consistency, always trim the trailing slash.
|
|
return new UriBuilder
|
|
return new UriBuilder
|
|
{
|
|
{
|
|
Scheme = scheme ?? (ListenWithHttps ? Uri.UriSchemeHttps : Uri.UriSchemeHttp),
|
|
Scheme = scheme ?? (ListenWithHttps ? Uri.UriSchemeHttps : Uri.UriSchemeHttp),
|
|
- Host = host,
|
|
|
|
|
|
+ Host = hostname,
|
|
Port = port ?? (ListenWithHttps ? HttpsPort : HttpPort),
|
|
Port = port ?? (ListenWithHttps ? HttpsPort : HttpPort),
|
|
Path = ConfigurationManager.GetNetworkConfiguration().BaseUrl
|
|
Path = ConfigurationManager.GetNetworkConfiguration().BaseUrl
|
|
}.ToString().TrimEnd('/');
|
|
}.ToString().TrimEnd('/');
|
|
@@ -1252,26 +1244,6 @@ namespace Emby.Server.Implementations
|
|
|
|
|
|
protected abstract void ShutdownInternal();
|
|
protected abstract void ShutdownInternal();
|
|
|
|
|
|
- public event EventHandler HasUpdateAvailableChanged;
|
|
|
|
-
|
|
|
|
- private bool _hasUpdateAvailable;
|
|
|
|
-
|
|
|
|
- public bool HasUpdateAvailable
|
|
|
|
- {
|
|
|
|
- get => _hasUpdateAvailable;
|
|
|
|
- set
|
|
|
|
- {
|
|
|
|
- var fireEvent = value && !_hasUpdateAvailable;
|
|
|
|
-
|
|
|
|
- _hasUpdateAvailable = value;
|
|
|
|
-
|
|
|
|
- if (fireEvent)
|
|
|
|
- {
|
|
|
|
- HasUpdateAvailableChanged?.Invoke(this, EventArgs.Empty);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
public IEnumerable<Assembly> GetApiPluginAssemblies()
|
|
public IEnumerable<Assembly> GetApiPluginAssemblies()
|
|
{
|
|
{
|
|
var assemblies = _allConcreteTypes
|
|
var assemblies = _allConcreteTypes
|