mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-21 22:25:03 -04:00
New: VIP Expiration notifications on Newznab
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
@@ -41,6 +42,14 @@ namespace NzbDrone.Core.Indexers.Newznab
|
||||
RuleFor(c => c.ApiKey).NotEmpty().When(ShouldHaveApiKey);
|
||||
RuleFor(c => c.AdditionalParameters).Matches(AdditionalParametersRegex)
|
||||
.When(c => !c.AdditionalParameters.IsNullOrWhiteSpace());
|
||||
|
||||
RuleFor(c => c.VipExpiration).Must(c => c.IsValidDate())
|
||||
.When(c => c.VipExpiration.IsNotNullOrWhiteSpace())
|
||||
.WithMessage("Correctly formatted date is required");
|
||||
|
||||
RuleFor(c => c.VipExpiration).Must(c => c.IsFutureDate())
|
||||
.When(c => c.VipExpiration.IsNotNullOrWhiteSpace())
|
||||
.WithMessage("Must be a future date");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,6 +60,7 @@ namespace NzbDrone.Core.Indexers.Newznab
|
||||
public NewznabSettings()
|
||||
{
|
||||
ApiPath = "/api";
|
||||
VipExpiration = "";
|
||||
}
|
||||
|
||||
[FieldDefinition(0, Label = "URL")]
|
||||
@@ -65,6 +75,9 @@ namespace NzbDrone.Core.Indexers.Newznab
|
||||
[FieldDefinition(5, Label = "Additional Parameters", HelpText = "Additional Newznab parameters", Advanced = true)]
|
||||
public string AdditionalParameters { get; set; }
|
||||
|
||||
[FieldDefinition(6, Label = "VIP Expiration", HelpText = "Enter date (yyyy-mm-dd) for VIP Expiration or blank, Prowlarr will notify 1 week from expiration of VIP")]
|
||||
public string VipExpiration { get; set; }
|
||||
|
||||
public List<IndexerCategory> Categories { get; set; }
|
||||
|
||||
// Field 8 is used by TorznabSettings MinimumSeeders
|
||||
|
||||
Reference in New Issue
Block a user