瀏覽代碼

Also add the WAN switch to the public system info.

Phlogi 6 年之前
父節點
當前提交
d18252542d
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      Emby.Server.Implementations/ApplicationHost.cs

+ 6 - 2
Emby.Server.Implementations/ApplicationHost.cs

@@ -1375,7 +1375,7 @@ namespace Emby.Server.Implementations
             var wanAddress = ServerConfigurationManager.Configuration.WanDdns;
             var wanAddress = ServerConfigurationManager.Configuration.WanDdns;
             
             
             if (string.IsNullOrEmpty(wanAddress)){
             if (string.IsNullOrEmpty(wanAddress)){
-                var wanAddress = await GetWanApiUrl(cancellationToken).ConfigureAwait(false);
+                wanAddress = await GetWanApiUrl(cancellationToken).ConfigureAwait(false);
             }
             }
 
 
             return new SystemInfo
             return new SystemInfo
@@ -1426,7 +1426,11 @@ namespace Emby.Server.Implementations
         public async Task<PublicSystemInfo> GetPublicSystemInfo(CancellationToken cancellationToken)
         public async Task<PublicSystemInfo> GetPublicSystemInfo(CancellationToken cancellationToken)
         {
         {
             var localAddress = await GetLocalApiUrl(cancellationToken).ConfigureAwait(false);
             var localAddress = await GetLocalApiUrl(cancellationToken).ConfigureAwait(false);
-            var wanAddress = await GetWanApiUrl(cancellationToken).ConfigureAwait(false);
+            var wanAddress = ServerConfigurationManager.Configuration.WanDdns;
+            
+            if (string.IsNullOrEmpty(wanAddress)){
+                wanAddress = await GetWanApiUrl(cancellationToken).ConfigureAwait(false);
+            }
             return new PublicSystemInfo
             return new PublicSystemInfo
             {
             {
                 Version = ApplicationVersion,
                 Version = ApplicationVersion,