mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-10 23:33:38 -07:00
New: Newznab/Torznab categories dropdown with indexer provided category names
This commit is contained in:
parent
2d8657a77f
commit
9b1bbaef02
22 changed files with 429 additions and 36 deletions
|
@ -2,6 +2,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using FluentValidation;
|
||||
using FluentValidation.Results;
|
||||
using Lidarr.Http.Extensions;
|
||||
using Nancy;
|
||||
using Nancy.Responses.Negotiation;
|
||||
|
@ -224,7 +225,7 @@ namespace Lidarr.Http.REST
|
|||
return Negotiate.WithModel(model).WithStatusCode(statusCode);
|
||||
}
|
||||
|
||||
protected TResource ReadResourceFromRequest(bool skipValidate = false)
|
||||
protected TResource ReadResourceFromRequest(bool skipValidate = false, bool skipSharedValidate = false)
|
||||
{
|
||||
var resource = new TResource();
|
||||
|
||||
|
@ -242,7 +243,12 @@ namespace Lidarr.Http.REST
|
|||
throw new BadRequestException("Request body can't be empty");
|
||||
}
|
||||
|
||||
var errors = SharedValidator.Validate(resource).Errors.ToList();
|
||||
var errors = new List<ValidationFailure>();
|
||||
|
||||
if (!skipSharedValidate)
|
||||
{
|
||||
errors.AddRange(SharedValidator.Validate(resource).Errors);
|
||||
}
|
||||
|
||||
if (Request.Method.Equals("POST", StringComparison.InvariantCultureIgnoreCase) && !skipValidate && !Request.Url.Path.EndsWith("/test", StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue