mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-27 02:07:41 +00:00
New: omgwtfnzbs delay now configurable (advanced)
This commit is contained in:
parent
ebe7b21a8c
commit
13b43dc084
2 changed files with 13 additions and 5 deletions
|
@ -92,7 +92,7 @@ namespace NzbDrone.Core.Indexers.Omgwtfnzbs
|
||||||
private IEnumerable<IndexerRequest> GetPagedRequests(String query)
|
private IEnumerable<IndexerRequest> GetPagedRequests(String query)
|
||||||
{
|
{
|
||||||
var url = new StringBuilder();
|
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())
|
if (query.IsNotNullOrWhiteSpace())
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using FluentValidation;
|
||||||
using FluentValidation;
|
|
||||||
using FluentValidation.Results;
|
using FluentValidation.Results;
|
||||||
using NzbDrone.Core.Annotations;
|
using NzbDrone.Core.Annotations;
|
||||||
using NzbDrone.Core.ThingiProvider;
|
using NzbDrone.Core.ThingiProvider;
|
||||||
|
@ -12,6 +11,7 @@ namespace NzbDrone.Core.Indexers.Omgwtfnzbs
|
||||||
{
|
{
|
||||||
RuleFor(c => c.Username).NotEmpty();
|
RuleFor(c => c.Username).NotEmpty();
|
||||||
RuleFor(c => c.ApiKey).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();
|
private static readonly OmgwtfnzbsSettingsValidator Validator = new OmgwtfnzbsSettingsValidator();
|
||||||
|
|
||||||
|
public OmgwtfnzbsSettings()
|
||||||
|
{
|
||||||
|
Delay = 30;
|
||||||
|
}
|
||||||
|
|
||||||
[FieldDefinition(0, Label = "Username")]
|
[FieldDefinition(0, Label = "Username")]
|
||||||
public String Username { get; set; }
|
public string Username { get; set; }
|
||||||
|
|
||||||
[FieldDefinition(1, Label = "API Key")]
|
[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()
|
public ValidationResult Validate()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue