From 749684e24a6f9b19cd19af6f85cab5814ec08ecc Mon Sep 17 00:00:00 2001 From: bakerboy448 <55419169+bakerboy448@users.noreply.github.com> Date: Fri, 9 Jun 2023 16:54:04 -0500 Subject: [PATCH] New: Indexer Messaging and Error Improvements (cherry picked from commit 3b505d8734dcbe3fa53acba7f94f1361151e6a44) --- src/NzbDrone.Common/Http/HttpResponse.cs | 2 + src/NzbDrone.Core/Indexers/HttpIndexerBase.cs | 93 +++++++++++++++---- src/NzbDrone.Core/Indexers/RssParser.cs | 3 +- 3 files changed, 77 insertions(+), 21 deletions(-) diff --git a/src/NzbDrone.Common/Http/HttpResponse.cs b/src/NzbDrone.Common/Http/HttpResponse.cs index bc4bc2c74..581c2e30e 100644 --- a/src/NzbDrone.Common/Http/HttpResponse.cs +++ b/src/NzbDrone.Common/Http/HttpResponse.cs @@ -50,6 +50,8 @@ public string Content public bool HasHttpError => (int)StatusCode >= 400; + public bool HasHttpServerError => (int)StatusCode >= 500; + public bool HasHttpRedirect => StatusCode == HttpStatusCode.Moved || StatusCode == HttpStatusCode.MovedPermanently || StatusCode == HttpStatusCode.Found || diff --git a/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs b/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs index c8feaf841..7a05071f5 100644 --- a/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs +++ b/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs @@ -2,6 +2,8 @@ using System.Collections.Generic; using System.Linq; using System.Net; +using System.Net.Http; +using System.Threading.Tasks; using FluentValidation.Results; using NLog; using NzbDrone.Common.Extensions; @@ -77,6 +79,7 @@ protected virtual IList FetchReleases(Func(); var url = string.Empty; + var minimumBackoff = TimeSpan.FromHours(1); try { @@ -169,8 +172,7 @@ protected virtual IList FetchReleases(Func FetchReleases(Func FetchReleases(Func FetchReleases(Func