1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-26 09:47:39 +00:00

New: omgwtfnzbs delay now configurable (advanced)

This commit is contained in:
Mark McDowall 2015-01-13 23:40:25 -08:00
parent ebe7b21a8c
commit 13b43dc084
2 changed files with 13 additions and 5 deletions

View file

@ -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())
{

View file

@ -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()
{