diff --git a/src/NzbDrone.Core/Notifications/NotificationFactory.cs b/src/NzbDrone.Core/Notifications/NotificationFactory.cs index d27e572f8..77548146e 100644 --- a/src/NzbDrone.Core/Notifications/NotificationFactory.cs +++ b/src/NzbDrone.Core/Notifications/NotificationFactory.cs @@ -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; @@ -193,5 +194,26 @@ namespace NzbDrone.Core.Notifications definition.SupportsOnTrackRetag = provider.SupportsOnTrackRetag; definition.SupportsOnApplicationUpdate = provider.SupportsOnApplicationUpdate; } + + public override ValidationResult Test(NotificationDefinition definition) + { + var result = base.Test(definition); + + if (definition.Id == 0) + { + return result; + } + + if (result == null || result.IsValid) + { + _notificationStatusService.RecordSuccess(definition.Id); + } + else + { + _notificationStatusService.RecordFailure(definition.Id); + } + + return result; + } } }