aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBaronGreenback <jimcartlidge@yahoo.co.uk>2021-02-27 13:56:21 +0000
committerBaronGreenback <jimcartlidge@yahoo.co.uk>2021-02-27 13:56:21 +0000
commita25e3c02568b5632278e23d6168efa927b29eda9 (patch)
treeb8c564138001cba1ae70f6e8acf057e8bf79a68f
parent0d3606a7466d55d217e1dffc0539cfa1c189eb7d (diff)
fix for override ports contained in PublishedServerUrl
-rw-r--r--Emby.Dlna/Main/DlnaEntryPoint.cs9
-rw-r--r--Emby.Server.Implementations/ApplicationHost.cs10
-rw-r--r--MediaBrowser.Controller/IServerApplicationHost.cs5
3 files changed, 21 insertions, 3 deletions
diff --git a/Emby.Dlna/Main/DlnaEntryPoint.cs b/Emby.Dlna/Main/DlnaEntryPoint.cs
index 82490ec31..2652e6245 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.cs
index 1b9bb86bb..604f69986 100644
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@ -135,6 +135,11 @@ namespace Emby.Server.Implementations
public 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.cs
index 92b2d43ce..b6f049391 100644
--- a/MediaBrowser.Controller/IServerApplicationHost.cs
+++ b/MediaBrowser.Controller/IServerApplicationHost.cs
@@ -53,6 +53,11 @@ namespace MediaBrowser.Controller
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>
/// <param name="source">The originator of the request.</param>