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:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user