diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-04-09 22:32:27 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-04-09 22:32:27 -0400 |
| commit | 6ea48d1e7c32f159c2e8c92f73f84b09bb78ec3f (patch) | |
| tree | fd907ec9c752b7c760ab764f74a15b35f6ff660d /MediaBrowser.Server.Implementations/Connect/ConnectManager.cs | |
| parent | be4f301198fa0d1d455478eebfc960a6e61c33e9 (diff) | |
| parent | 638dba51ec75f9180c44ec4e75b67f7cea774910 (diff) | |
Merge branch 'beta'
Diffstat (limited to 'MediaBrowser.Server.Implementations/Connect/ConnectManager.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Connect/ConnectManager.cs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs index ac0d2c569..e308acef0 100644 --- a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs +++ b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs @@ -62,6 +62,17 @@ namespace MediaBrowser.Server.Implementations.Connect { var address = _config.Configuration.WanDdns; + if (!string.IsNullOrWhiteSpace(address)) + { + try + { + address = new Uri(address).Host; + } + catch + { + } + } + if (string.IsNullOrWhiteSpace(address) && DiscoveredWanIpAddress != null) { if (DiscoveredWanIpAddress.AddressFamily == AddressFamily.InterNetworkV6) @@ -237,8 +248,8 @@ namespace MediaBrowser.Server.Implementations.Connect var postData = new Dictionary<string, string> { - {"name", _appHost.FriendlyName}, - {"url", wanApiAddress}, + {"name", _appHost.FriendlyName}, + {"url", wanApiAddress}, {"systemId", _appHost.SystemId} }; @@ -891,8 +902,7 @@ namespace MediaBrowser.Server.Implementations.Connect private async Task RefreshGuestNames(List<ServerUserAuthorizationResponse> list, bool refreshImages) { var users = _userManager.Users - .Where(i => !string.IsNullOrEmpty(i.ConnectUserId) && - (i.ConnectLinkType.HasValue && i.ConnectLinkType.Value == UserLinkType.Guest)) + .Where(i => !string.IsNullOrEmpty(i.ConnectUserId) && i.ConnectLinkType.HasValue && i.ConnectLinkType.Value == UserLinkType.Guest) .ToList(); foreach (var user in users) |
