New: (FlareSolverr Proxy) Configurable Request Timeout

Closes #696
This commit is contained in:
bakerboy448
2021-12-11 15:51:45 -06:00
parent 62d15536df
commit 383d5464b7
2 changed files with 7 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
using FluentValidation;
using NLog.Config;
using NzbDrone.Core.Annotations;
using NzbDrone.Core.Validation;
@@ -9,6 +10,7 @@ namespace NzbDrone.Core.IndexerProxies.FlareSolverr
public FlareSolverrSettingsValidator()
{
RuleFor(c => c.Host).NotEmpty();
RuleFor(c => c.RequestTimeout).InclusiveBetween(1, 180);
}
}
@@ -19,11 +21,15 @@ namespace NzbDrone.Core.IndexerProxies.FlareSolverr
public FlareSolverrSettings()
{
Host = "http://localhost:8191/";
RequestTimeout = 60;
}
[FieldDefinition(0, Label = "Host")]
public string Host { get; set; }
[FieldDefinition(2, Label = "Request Timeout", Advanced = true, HelpText = "FlareSolverr maxTimeout Request Parameter", Unit = "seconds")]
public int RequestTimeout { get; set; }
public NzbDroneValidationResult Validate()
{
return new NzbDroneValidationResult(Validator.Validate(this));