diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-10-07 17:42:29 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-10-07 17:42:29 -0400 |
| commit | b1859d41e861630a95357bf21bb46af6c4fb5686 (patch) | |
| tree | b6309083d34e9be8bea03cae82ca6b6e5b35d7eb /MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs | |
| parent | b82254060d2fa33ffb2fd87ba31196d61a4940af (diff) | |
update collection menus
Diffstat (limited to 'MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs b/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs index c7e437931..9622afb97 100644 --- a/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs +++ b/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs @@ -49,14 +49,23 @@ namespace MediaBrowser.Server.Implementations.Connect private async void TimerCallback(object state) { + var index = 0; + foreach (var ipLookupUrl in _ipLookups) { try { + // Sometimes whatismyipaddress might fail, but it won't do us any good having users raise alarms over it. + var logErrors = index > 0; + +#if DEBUG + logErrors = true; +#endif using (var stream = await _httpClient.Get(new HttpRequestOptions { Url = ipLookupUrl, - UserAgent = "Emby Server/" + _appHost.ApplicationVersion + UserAgent = "Emby Server/" + _appHost.ApplicationVersion, + LogErrors = logErrors }).ConfigureAwait(false)) { @@ -80,6 +89,8 @@ namespace MediaBrowser.Server.Implementations.Connect { _logger.ErrorException("Error getting connection info", ex); } + + index++; } } @@ -94,8 +105,8 @@ namespace MediaBrowser.Server.Implementations.Connect try { - _fileSystem.CreateDirectory(Path.GetDirectoryName(path)); - _fileSystem.WriteAllText(path, address, Encoding.UTF8); + _fileSystem.CreateDirectory(Path.GetDirectoryName(path)); + _fileSystem.WriteAllText(path, address, Encoding.UTF8); } catch (Exception ex) { @@ -109,7 +120,7 @@ namespace MediaBrowser.Server.Implementations.Connect try { - var endpoint = _fileSystem.ReadAllText(path, Encoding.UTF8); + var endpoint = _fileSystem.ReadAllText(path, Encoding.UTF8); if (IsValid(endpoint)) { |
