The Free Software Media System - Server Backend & API
fix for override ports contained in PublishedServerUrl
BaronGreenbacka25e3c02568b
diff --git a/Emby.Dlna/Main/DlnaEntryPoint.cs b/Emby.Dlna/Main/DlnaEntryPoint.csindex 82490ec310..2652e62457 100644--- a/Emby.Dlna/Main/DlnaEntryPoint.cs+++ b/Emby.Dlna/Main/DlnaEntryPoint.cs@@ -313,9 +313,12 @@ namespace Emby.Dlna.Main_logger.LogInformation("Registering publisher for {0} on {1}", fullService, address);var uri = new UriBuilder(_appHost.GetSmartApiUrl(address.Address) + descriptorUri);- // DLNA will only work over http, so we must reset to http:// : {port}- uri.Scheme = "http://";- uri.Port = _netConfig.HttpServerPortNumber;+ if (string.IsNullOrEmpty(_appHost.PublishedServerUrl))+ {+ // DLNA will only work over http, so we must reset to http:// : {port}.+ uri.Scheme = "http";+ uri.Port = _netConfig.HttpServerPortNumber;+ }var device = new SsdpRootDevice{diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.csindex 1b9bb86bbd..604f699862 100644--- a/Emby.Server.Implementations/ApplicationHost.cs+++ b/Emby.Server.Implementations/ApplicationHost.cs@@ -135,6 +135,11 @@ namespace Emby.Server.Implementationspublic bool CoreStartupHasCompleted { get; private set; }+ /// <summary>+ /// Gets a value indicating whether this instance has a custom published url.+ /// </summary>+ public Uri PublishedServerUrl => _startupOptions.PublishedServerUrl;+public virtual bool CanLaunchWebBrowser{get@@ -1141,6 +1146,11 @@ namespace Emby.Server.Implementations/// <inheritdoc/>public bool ListenWithHttps => Certificate != null && ServerConfigurationManager.GetNetworkConfiguration().EnableHttps;+ public string GetStartupOption(string propName)+ {+ return _startupOptions.GetType().GetProperty(propName).GetValue(src, null);+ }+/// <inheritdoc/>public string GetSmartApiUrl(IPAddress ipAddress, int? port = null){diff --git a/MediaBrowser.Controller/IServerApplicationHost.cs b/MediaBrowser.Controller/IServerApplicationHost.csindex 92b2d43ce2..b6f049391f 100644--- a/MediaBrowser.Controller/IServerApplicationHost.cs+++ b/MediaBrowser.Controller/IServerApplicationHost.cs@@ -52,6 +52,11 @@ namespace MediaBrowser.Controller/// <value>The name of the friendly.</value>string FriendlyName { get; }+ /// <summary>+ /// Gets a value indicating whether this instance has a custom published url.+ /// </summary>+ Uri PublishedServerUrl { get; }+/// <summary>/// Gets the system info./// </summary>