diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-09-23 21:10:16 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-23 21:10:16 -0400 |
| commit | 65878a72daa10c9fb5ae61e4c77291428803ba6c (patch) | |
| tree | 795629f8180a119ffb4c36824aed13e65b0bbdd2 /Emby.Server.Implementations/ApplicationHost.cs | |
| parent | 0b72b3b1a73c4bbdd25172348e4e6f82c1ecf946 (diff) | |
| parent | 98f4da6d1471c51ef39fb87de01a1185bb41487e (diff) | |
Merge pull request #2911 from MediaBrowser/dev
Dev
Diffstat (limited to 'Emby.Server.Implementations/ApplicationHost.cs')
| -rw-r--r-- | Emby.Server.Implementations/ApplicationHost.cs | 41 |
1 files changed, 29 insertions, 12 deletions
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index ba43c7f35..894d91f71 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -2211,19 +2211,36 @@ namespace Emby.Server.Implementations TimeSpan.FromHours(12) : TimeSpan.FromMinutes(5); - var result = await new GithubUpdater(HttpClient, JsonSerializer).CheckForUpdateResult("MediaBrowser", - "Emby", - ApplicationVersion, - updateLevel, - ReleaseAssetFilename, - "MBServer", - UpdateTargetFileName, - cacheLength, - cancellationToken).ConfigureAwait(false); - - HasUpdateAvailable = result.IsUpdateAvailable; + try + { + var result = await new GithubUpdater(HttpClient, JsonSerializer).CheckForUpdateResult("MediaBrowser", + "Emby", + ApplicationVersion, + updateLevel, + ReleaseAssetFilename, + "MBServer", + UpdateTargetFileName, + cacheLength, + cancellationToken).ConfigureAwait(false); - return result; + HasUpdateAvailable = result.IsUpdateAvailable; + + return result; + } + catch (HttpException ex) + { + // users are overreacting to this occasionally failing + if (ex.StatusCode.HasValue && ex.StatusCode.Value == HttpStatusCode.Forbidden) + { + HasUpdateAvailable = false; + return new CheckForUpdateResult + { + IsUpdateAvailable = false + }; + } + + throw; + } } protected virtual string UpdateTargetFileName |
