mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-26 22:46:37 -04:00
New: Will now temporarily stop using an indexer if the indexer reported an error.
This commit is contained in:
@@ -15,6 +15,7 @@ namespace NzbDrone.Core.Indexers
|
||||
public abstract class IndexerBase<TSettings> : IIndexer
|
||||
where TSettings : IProviderConfig, new()
|
||||
{
|
||||
protected readonly IIndexerStatusService _indexerStatusService;
|
||||
protected readonly IConfigService _configService;
|
||||
protected readonly IParsingService _parsingService;
|
||||
protected readonly Logger _logger;
|
||||
@@ -25,8 +26,9 @@ namespace NzbDrone.Core.Indexers
|
||||
public abstract Boolean SupportsRss { get; }
|
||||
public abstract Boolean SupportsSearch { get; }
|
||||
|
||||
public IndexerBase(IConfigService configService, IParsingService parsingService, Logger logger)
|
||||
public IndexerBase(IIndexerStatusService indexerStatusService, IConfigService configService, IParsingService parsingService, Logger logger)
|
||||
{
|
||||
_indexerStatusService = indexerStatusService;
|
||||
_configService = configService;
|
||||
_parsingService = parsingService;
|
||||
_logger = logger;
|
||||
@@ -85,6 +87,7 @@ namespace NzbDrone.Core.Indexers
|
||||
|
||||
result.ForEach(c =>
|
||||
{
|
||||
c.IndexerId = Definition.Id;
|
||||
c.Indexer = Definition.Name;
|
||||
c.DownloadProtocol = Protocol;
|
||||
});
|
||||
@@ -106,6 +109,11 @@ namespace NzbDrone.Core.Indexers
|
||||
failures.Add(new ValidationFailure(string.Empty, "Test was aborted due to an error: " + ex.Message));
|
||||
}
|
||||
|
||||
if (Definition.Id != 0)
|
||||
{
|
||||
_indexerStatusService.RecordSuccess(Definition.Id);
|
||||
}
|
||||
|
||||
return new ValidationResult(failures);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user