New: Will now temporarily stop using an indexer if the indexer reported an error.

This commit is contained in:
Taloth Saldono
2015-06-27 11:43:17 +02:00
parent 6d046a8df8
commit f2a70677e4
61 changed files with 994 additions and 173 deletions
+9 -1
View File
@@ -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);
}