Files
Readarr/src/Readarr.Api.V1/DownloadClient/DownloadClientController.cs
Bogdan 080dd301f3 Fixed: Priority validation for indexers and download clients
(cherry picked from commit f0e320f3aa501f120721503b8256f464a31be783)
2025-03-26 12:35:30 +02:00

20 lines
774 B
C#

using FluentValidation;
using NzbDrone.Core.Download;
using Readarr.Http;
namespace Readarr.Api.V1.DownloadClient
{
[V1ApiController]
public class DownloadClientController : ProviderControllerBase<DownloadClientResource, DownloadClientBulkResource, IDownloadClient, DownloadClientDefinition>
{
public static readonly DownloadClientResourceMapper ResourceMapper = new ();
public static readonly DownloadClientBulkResourceMapper BulkResourceMapper = new ();
public DownloadClientController(IDownloadClientFactory downloadClientFactory)
: base(downloadClientFactory, "downloadclient", ResourceMapper, BulkResourceMapper)
{
SharedValidator.RuleFor(c => c.Priority).InclusiveBetween(1, 50);
}
}
}