New: omgwtfnzbs delay now configurable (advanced)

pull/4/head
Mark McDowall 10 years ago
parent ebe7b21a8c
commit 13b43dc084

@ -92,7 +92,7 @@ namespace NzbDrone.Core.Indexers.Omgwtfnzbs
private IEnumerable<IndexerRequest> GetPagedRequests(String query)
{
var url = new StringBuilder();
url.AppendFormat("{0}?catid=19,20&user={1}&api={2}&eng=1&delay=30", BaseUrl, Settings.Username, Settings.ApiKey);
url.AppendFormat("{0}?catid=19,20&user={1}&api={2}&eng=1&delay={3}", BaseUrl, Settings.Username, Settings.ApiKey, Settings.Delay);
if (query.IsNotNullOrWhiteSpace())
{

@ -1,5 +1,4 @@
using System;
using FluentValidation;
using FluentValidation;
using FluentValidation.Results;
using NzbDrone.Core.Annotations;
using NzbDrone.Core.ThingiProvider;
@ -12,6 +11,7 @@ namespace NzbDrone.Core.Indexers.Omgwtfnzbs
{
RuleFor(c => c.Username).NotEmpty();
RuleFor(c => c.ApiKey).NotEmpty();
RuleFor(c => c.Delay).GreaterThanOrEqualTo(0);
}
}
@ -19,11 +19,19 @@ namespace NzbDrone.Core.Indexers.Omgwtfnzbs
{
private static readonly OmgwtfnzbsSettingsValidator Validator = new OmgwtfnzbsSettingsValidator();
public OmgwtfnzbsSettings()
{
Delay = 30;
}
[FieldDefinition(0, Label = "Username")]
public String Username { get; set; }
public string Username { get; set; }
[FieldDefinition(1, Label = "API Key")]
public String ApiKey { get; set; }
public string ApiKey { get; set; }
[FieldDefinition(2, Label = "Delay", HelpText = "Time in minutes to delay new nzbs before they appear on the RSS feed", Advanced = true)]
public int Delay { get; set; }
public ValidationResult Validate()
{

Loading…
Cancel
Save