From d70e08331ff331de49b5a946bc5d33098a736b7a Mon Sep 17 00:00:00 2001 From: Qstick Date: Sat, 20 Feb 2021 17:24:31 -0500 Subject: [PATCH] Clear failed Application Status on successful Test --- .../Applications/ApplicationFactory.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/NzbDrone.Core/Applications/ApplicationFactory.cs b/src/NzbDrone.Core/Applications/ApplicationFactory.cs index 4bfd53382..943fd684c 100644 --- a/src/NzbDrone.Core/Applications/ApplicationFactory.cs +++ b/src/NzbDrone.Core/Applications/ApplicationFactory.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Linq; +using FluentValidation.Results; using NLog; using NzbDrone.Common.Composition; using NzbDrone.Core.Messaging.Events; @@ -57,5 +58,17 @@ namespace NzbDrone.Core.Applications yield return application; } } + + public override ValidationResult Test(ApplicationDefinition definition) + { + var result = base.Test(definition); + + if ((result == null || result.IsValid) && definition.Id != 0) + { + _applicationStatusService.RecordSuccess(definition.Id); + } + + return result; + } } }