From c22c9400c23a56813f2101b3a12c44945076ce00 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 | 86 +++++++++++++------ src/NzbDrone.Core/Indexers/RssParser.cs | 13 +-- 3 files changed, 71 insertions(+), 30 deletions(-) diff --git a/src/NzbDrone.Common/Http/HttpResponse.cs b/src/NzbDrone.Common/Http/HttpResponse.cs index 43340c40e..2d3b169f5 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 608a5273f..c473b95b8 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; @@ -94,6 +96,7 @@ protected virtual IList FetchReleases(Func(); var url = string.Empty; + var minimumBackoff = TimeSpan.FromHours(1); try { @@ -190,8 +193,7 @@ protected virtual IList FetchReleases(Func FetchReleases(Func FetchReleases(Func FetchReleases(Func