mirror of
https://github.com/lidarr/Lidarr
synced 2025-02-25 07:12:40 +00:00
Fixed: Record status for notifications on tests
(cherry picked from commit 3d05913534e40e1b9ff217798d806d0b7c170d2d)
This commit is contained in:
parent
b919941891
commit
8e847e6ba9
1 changed files with 22 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using FluentValidation.Results;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NzbDrone.Core.Messaging.Events;
|
using NzbDrone.Core.Messaging.Events;
|
||||||
using NzbDrone.Core.ThingiProvider;
|
using NzbDrone.Core.ThingiProvider;
|
||||||
|
@ -193,5 +194,26 @@ public override void SetProviderCharacteristics(INotification provider, Notifica
|
||||||
definition.SupportsOnTrackRetag = provider.SupportsOnTrackRetag;
|
definition.SupportsOnTrackRetag = provider.SupportsOnTrackRetag;
|
||||||
definition.SupportsOnApplicationUpdate = provider.SupportsOnApplicationUpdate;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue