diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-06-19 02:21:51 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-06-19 02:21:51 -0400 |
| commit | 963450f17a1d0c6487f55c0b78779c3070f5a594 (patch) | |
| tree | be5750566a0ee766404a2e22769d1a270697b29e /MediaBrowser.Server.Implementations/Connect/ConnectManager.cs | |
| parent | 0edd4e71fb54b808ab7a6d87cfd10010f1db0120 (diff) | |
| parent | 759f5a856064450acdb4c26839d6d890afb99a17 (diff) | |
Merge pull request #1860 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Server.Implementations/Connect/ConnectManager.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Connect/ConnectManager.cs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs index f3d5454921..6190a9da08 100644 --- a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs +++ b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs @@ -177,7 +177,7 @@ namespace MediaBrowser.Server.Implementations.Connect try { - var localAddress = _appHost.LocalApiUrl; + var localAddress = await _appHost.GetLocalApiUrl().ConfigureAwait(false); var hasExistingRecord = !string.IsNullOrWhiteSpace(ConnectServerId) && !string.IsNullOrWhiteSpace(ConnectAccessKey); @@ -217,24 +217,26 @@ namespace MediaBrowser.Server.Implementations.Connect } private string _lastReportedIdentifier; - private string GetConnectReportingIdentifier() + private async Task<string> GetConnectReportingIdentifier() { - return GetConnectReportingIdentifier(_appHost.LocalApiUrl, WanApiAddress); + var url = await _appHost.GetLocalApiUrl().ConfigureAwait(false); + return GetConnectReportingIdentifier(url, WanApiAddress); } private string GetConnectReportingIdentifier(string localAddress, string remoteAddress) { return (remoteAddress ?? string.Empty) + (localAddress ?? string.Empty); } - void _config_ConfigurationUpdated(object sender, EventArgs e) + async void _config_ConfigurationUpdated(object sender, EventArgs e) { // If info hasn't changed, don't report anything - if (string.Equals(_lastReportedIdentifier, GetConnectReportingIdentifier(), StringComparison.OrdinalIgnoreCase)) + var connectIdentifier = await GetConnectReportingIdentifier().ConfigureAwait(false); + if (string.Equals(_lastReportedIdentifier, connectIdentifier, StringComparison.OrdinalIgnoreCase)) { return; } - UpdateConnectInfo(); + await UpdateConnectInfo().ConfigureAwait(false); } private async Task CreateServerRegistration(string wanApiAddress, string localAddress) |
