Apply review suggestions

This commit is contained in:
Shadowghost 2023-07-03 15:59:39 +02:00
parent 32ac3b580c
commit e233a3b074
4 changed files with 24 additions and 24 deletions

View File

@ -475,8 +475,8 @@ namespace Emby.Server.Implementations
}
var networkConfiguration = ConfigurationManager.GetNetworkConfiguration();
HttpPort = networkConfiguration.ServerPortNumberHttp;
HttpsPort = networkConfiguration.ServerPortNumberHttps;
HttpPort = networkConfiguration.InternalHttpPort;
HttpsPort = networkConfiguration.InternalHttpsPort;
// Safeguard against invalid configuration
if (HttpPort == HttpsPort)
@ -785,8 +785,8 @@ namespace Emby.Server.Implementations
if (HttpPort != 0 && HttpsPort != 0)
{
// Need to restart if ports have changed
if (networkConfiguration.ServerPortNumberHttp != HttpPort
|| networkConfiguration.ServerPortNumberHttps != HttpsPort)
if (networkConfiguration.InternalHttpPort != HttpPort
|| networkConfiguration.InternalHttpsPort != HttpsPort)
{
if (ConfigurationManager.Configuration.IsPortAuthorized)
{

View File

@ -57,8 +57,8 @@ namespace Emby.Server.Implementations.EntryPoints
return new StringBuilder(32)
.Append(config.EnableUPnP).Append(Separator)
.Append(config.PublicPortHttp).Append(Separator)
.Append(config.PublicPortHttps).Append(Separator)
.Append(config.PublicHttpPort).Append(Separator)
.Append(config.PublicHttpsPort).Append(Separator)
.Append(_appHost.HttpPort).Append(Separator)
.Append(_appHost.HttpsPort).Append(Separator)
.Append(_appHost.ListenWithHttps).Append(Separator)
@ -146,11 +146,11 @@ namespace Emby.Server.Implementations.EntryPoints
private IEnumerable<Task> CreatePortMaps(INatDevice device)
{
var config = _config.GetNetworkConfiguration();
yield return CreatePortMap(device, _appHost.HttpPort, config.PublicPortHttp);
yield return CreatePortMap(device, _appHost.HttpPort, config.PublicHttpPort);
if (_appHost.ListenWithHttps)
{
yield return CreatePortMap(device, _appHost.HttpsPort, config.PublicPortHttps);
yield return CreatePortMap(device, _appHost.HttpsPort, config.PublicHttpsPort);
}
}

View File

@ -10,12 +10,12 @@ namespace Jellyfin.Networking.Configuration
public class NetworkConfiguration
{
/// <summary>
/// The default value for <see cref="ServerPortNumberHttp"/>.
/// The default value for <see cref="InternalHttpPort"/>.
/// </summary>
public const int DefaultHttpPort = 8096;
/// <summary>
/// The default value for <see cref="PublicPortHttps"/> and <see cref="ServerPortNumberHttps"/>.
/// The default value for <see cref="PublicHttpsPort"/> and <see cref="InternalHttpsPort"/>.
/// </summary>
public const int DefaultHttpsPort = 8920;
@ -79,28 +79,28 @@ namespace Jellyfin.Networking.Configuration
public string CertificatePassword { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the HTTP server port number.
/// Gets or sets the internal HTTP server port.
/// </summary>
/// <value>The HTTP server port number.</value>
public int ServerPortNumberHttp { get; set; } = DefaultHttpPort;
/// <value>The HTTP server port.</value>
public int InternalHttpPort { get; set; } = DefaultHttpPort;
/// <summary>
/// Gets or sets the HTTPS server port number.
/// Gets or sets the internal HTTPS server port.
/// </summary>
/// <value>The HTTPS server port number.</value>
public int ServerPortNumberHttps { get; set; } = DefaultHttpsPort;
/// <value>The HTTPS server port.</value>
public int InternalHttpsPort { get; set; } = DefaultHttpsPort;
/// <summary>
/// Gets or sets the public mapped port.
/// Gets or sets the public HTTP port.
/// </summary>
/// <value>The public mapped port.</value>
public int PublicPortHttp { get; set; } = DefaultHttpPort;
/// <value>The public HTTP port.</value>
public int PublicHttpPort { get; set; } = DefaultHttpPort;
/// <summary>
/// Gets or sets the public HTTPS port.
/// </summary>
/// <value>The public HTTPS port.</value>
public int PublicPortHttps { get; set; } = DefaultHttpsPort;
public int PublicHttpsPort { get; set; } = DefaultHttpsPort;
/// <summary>
/// Gets or sets a value indicating whether Autodiscovery is enabled.

View File

@ -57,17 +57,17 @@ public class MigrateNetworkConfiguration : IMigrationRoutine
networkConfiguration.EnableRemoteAccess = oldNetworkConfiguration.EnableRemoteAccess;
networkConfiguration.EnableUPnP = oldNetworkConfiguration.EnableUPnP;
networkConfiguration.IgnoreVirtualInterfaces = oldNetworkConfiguration.IgnoreVirtualInterfaces;
networkConfiguration.InternalHttpPort = oldNetworkConfiguration.HttpServerPortNumber;
networkConfiguration.InternalHttpsPort = oldNetworkConfiguration.HttpsPortNumber;
networkConfiguration.IsRemoteIPFilterBlacklist = oldNetworkConfiguration.IsRemoteIPFilterBlacklist;
networkConfiguration.KnownProxies = oldNetworkConfiguration.KnownProxies;
networkConfiguration.LocalNetworkAddresses = oldNetworkConfiguration.LocalNetworkAddresses;
networkConfiguration.LocalNetworkSubnets = oldNetworkConfiguration.LocalNetworkSubnets;
networkConfiguration.PublicPortHttp = oldNetworkConfiguration.PublicPort;
networkConfiguration.PublicPortHttps = oldNetworkConfiguration.PublicHttpsPort;
networkConfiguration.PublicHttpPort = oldNetworkConfiguration.PublicPort;
networkConfiguration.PublicHttpsPort = oldNetworkConfiguration.PublicHttpsPort;
networkConfiguration.PublishedServerUriBySubnet = oldNetworkConfiguration.PublishedServerUriBySubnet;
networkConfiguration.RemoteIPFilter = oldNetworkConfiguration.RemoteIPFilter;
networkConfiguration.RequireHttps = oldNetworkConfiguration.RequireHttps;
networkConfiguration.ServerPortNumberHttp = oldNetworkConfiguration.HttpServerPortNumber;
networkConfiguration.ServerPortNumberHttps = oldNetworkConfiguration.HttpsPortNumber;
// Migrate old virtual interface name schema
var oldVirtualInterfaceNames = oldNetworkConfiguration.VirtualInterfaceNames;