mirror of
https://github.com/Radarr/Radarr
synced 2025-02-01 12:21:49 +00:00
Fixed: Ensure failing providers are marked as failed when testing all
(cherry picked from commit f6c05d4456a5667398319e249614e2eed115621e) Closes #8960
This commit is contained in:
parent
4fb632e4fc
commit
298077940e
2 changed files with 32 additions and 1 deletions
|
@ -74,10 +74,19 @@ public override ValidationResult Test(DownloadClientDefinition definition)
|
|||
{
|
||||
var result = base.Test(definition);
|
||||
|
||||
if ((result == null || result.IsValid) && definition.Id != 0)
|
||||
if (definition.Id == 0)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
if (result == null || result.IsValid)
|
||||
{
|
||||
_downloadClientStatusService.RecordSuccess(definition.Id);
|
||||
}
|
||||
else
|
||||
{
|
||||
_downloadClientStatusService.RecordFailure(definition.Id);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using FluentValidation.Results;
|
||||
using NLog;
|
||||
using NzbDrone.Core.Messaging.Events;
|
||||
using NzbDrone.Core.ThingiProvider;
|
||||
|
@ -77,5 +78,26 @@ private IEnumerable<IImportList> FilterBlockedImportLists(IEnumerable<IImportLis
|
|||
yield return importList;
|
||||
}
|
||||
}
|
||||
|
||||
public override ValidationResult Test(ImportListDefinition definition)
|
||||
{
|
||||
var result = base.Test(definition);
|
||||
|
||||
if (definition.Id == 0)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
if (result == null || result.IsValid)
|
||||
{
|
||||
_importListStatusService.RecordSuccess(definition.Id);
|
||||
}
|
||||
else
|
||||
{
|
||||
_importListStatusService.RecordFailure(definition.Id);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue