diff options
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 |
