From 4b6ff7ffa5f88992420976c2c28e898dfdcbe4dc Mon Sep 17 00:00:00 2001 From: Claus Vium Date: Sat, 27 Feb 2021 20:01:51 +0100 Subject: [PATCH] Merge pull request #5312 from BaronGreenback/FixFor5280 (cherry picked from commit 9e77fdc70df59cd8f6a60425c5e79c5aeb9b13c8) Signed-off-by: Joshua M. Boniface --- Emby.Dlna/Main/DlnaEntryPoint.cs | 9 ++++++--- Emby.Server.Implementations/ApplicationHost.cs | 3 +++ MediaBrowser.Controller/IServerApplicationHost.cs | 5 +++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Emby.Dlna/Main/DlnaEntryPoint.cs b/Emby.Dlna/Main/DlnaEntryPoint.cs index 8f60c3f783..ec87160293 100644 --- a/Emby.Dlna/Main/DlnaEntryPoint.cs +++ b/Emby.Dlna/Main/DlnaEntryPoint.cs @@ -316,9 +316,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 (_appHost.PublishedServerUrl == null) + { + // 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.cs index a24f941d03..2ba585d304 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -134,6 +134,9 @@ namespace Emby.Server.Implementations public bool CoreStartupHasCompleted { get; private set; } + /// + public Uri PublishedServerUrl => _startupOptions.PublishedServerUrl; + public virtual bool CanLaunchWebBrowser { get diff --git a/MediaBrowser.Controller/IServerApplicationHost.cs b/MediaBrowser.Controller/IServerApplicationHost.cs index 92b2d43ce2..6378625e87 100644 --- a/MediaBrowser.Controller/IServerApplicationHost.cs +++ b/MediaBrowser.Controller/IServerApplicationHost.cs @@ -52,6 +52,11 @@ namespace MediaBrowser.Controller /// The name of the friendly. string FriendlyName { get; } + /// + /// Gets the configured published server url. + /// + Uri PublishedServerUrl { get; } + /// /// Gets the system info. ///