aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/ApplicationHost.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2017-09-23 21:10:16 -0400
committerGitHub <noreply@github.com>2017-09-23 21:10:16 -0400
commit65878a72daa10c9fb5ae61e4c77291428803ba6c (patch)
tree795629f8180a119ffb4c36824aed13e65b0bbdd2 /Emby.Server.Implementations/ApplicationHost.cs
parent0b72b3b1a73c4bbdd25172348e4e6f82c1ecf946 (diff)
parent98f4da6d1471c51ef39fb87de01a1185bb41487e (diff)
Merge pull request #2911 from MediaBrowser/dev
Dev
Diffstat (limited to 'Emby.Server.Implementations/ApplicationHost.cs')
-rw-r--r--Emby.Server.Implementations/ApplicationHost.cs41
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