1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-23 22:25:14 -04:00

New: Add support for Simplepush notifications (#6597)

* New: Add support for Simplepush notifications

* Add HelpText for Simplepush Events field
This commit is contained in:
Timm Schäuble
2021-10-02 17:15:54 +02:00
committed by GitHub
parent 8f4b028abe
commit d0fbcffa42
3 changed files with 146 additions and 0 deletions
@@ -0,0 +1,34 @@
using System.Collections.Generic;
using FluentValidation;
using NzbDrone.Core.Annotations;
using NzbDrone.Core.ThingiProvider;
using NzbDrone.Core.Validation;
namespace NzbDrone.Core.Notifications.Simplepush
{
public class SimplepushSettingsValidator : AbstractValidator<SimplepushSettings>
{
public SimplepushSettingsValidator()
{
RuleFor(c => c.Key).NotEmpty();
}
}
public class SimplepushSettings : IProviderConfig
{
private static readonly SimplepushSettingsValidator Validator = new SimplepushSettingsValidator();
[FieldDefinition(0, Label = "Key", Privacy = PrivacyLevel.ApiKey, HelpLink = "https://simplepush.io/features")]
public string Key { get; set; }
[FieldDefinition(1, Label = "Event", HelpText = "Customize the behavior of push notifications", HelpLink = "https://simplepush.io/features")]
public string Event { get; set; }
public bool IsValid => !string.IsNullOrWhiteSpace(Key);
public NzbDroneValidationResult Validate()
{
return new NzbDroneValidationResult(Validator.Validate(this));
}
}
}