New: OnGrab Notifications

This commit is contained in:
Qstick
2022-11-19 12:07:08 -06:00
parent 99bc56efb6
commit 1640980e2b
48 changed files with 543 additions and 111 deletions
@@ -9,6 +9,7 @@ namespace NzbDrone.Core.Notifications
{
public interface INotificationFactory : IProviderFactory<INotification, NotificationDefinition>
{
List<INotification> OnGrabEnabled();
List<INotification> OnHealthIssueEnabled();
List<INotification> OnApplicationUpdateEnabled();
}
@@ -20,6 +21,11 @@ namespace NzbDrone.Core.Notifications
{
}
public List<INotification> OnGrabEnabled()
{
return GetAvailableProviders().Where(n => ((NotificationDefinition)n.Definition).OnGrab).ToList();
}
public List<INotification> OnHealthIssueEnabled()
{
return GetAvailableProviders().Where(n => ((NotificationDefinition)n.Definition).OnHealthIssue).ToList();
@@ -34,6 +40,7 @@ namespace NzbDrone.Core.Notifications
{
base.SetProviderCharacteristics(provider, definition);
definition.SupportsOnGrab = provider.SupportsOnGrab;
definition.SupportsOnHealthIssue = provider.SupportsOnHealthIssue;
definition.SupportsOnApplicationUpdate = provider.SupportsOnApplicationUpdate;
}