mirror of
https://github.com/fergalmoran/Readarr.git
synced 2025-12-22 09:29:59 +00:00
Fixed: Priority validation for indexers and download clients
(cherry picked from commit f0e320f3aa501f120721503b8256f464a31be783)
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
using FluentValidation;
|
||||||
using NzbDrone.Core.Download;
|
using NzbDrone.Core.Download;
|
||||||
using Readarr.Http;
|
using Readarr.Http;
|
||||||
|
|
||||||
@@ -12,6 +13,7 @@ namespace Readarr.Api.V1.DownloadClient
|
|||||||
public DownloadClientController(IDownloadClientFactory downloadClientFactory)
|
public DownloadClientController(IDownloadClientFactory downloadClientFactory)
|
||||||
: base(downloadClientFactory, "downloadclient", ResourceMapper, BulkResourceMapper)
|
: base(downloadClientFactory, "downloadclient", ResourceMapper, BulkResourceMapper)
|
||||||
{
|
{
|
||||||
|
SharedValidator.RuleFor(c => c.Priority).InclusiveBetween(1, 50);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using FluentValidation;
|
||||||
using NzbDrone.Core.Indexers;
|
using NzbDrone.Core.Indexers;
|
||||||
using NzbDrone.Core.Validation;
|
using NzbDrone.Core.Validation;
|
||||||
using Readarr.Http;
|
using Readarr.Http;
|
||||||
@@ -13,6 +14,7 @@ namespace Readarr.Api.V1.Indexers
|
|||||||
public IndexerController(IndexerFactory indexerFactory, DownloadClientExistsValidator downloadClientExistsValidator)
|
public IndexerController(IndexerFactory indexerFactory, DownloadClientExistsValidator downloadClientExistsValidator)
|
||||||
: base(indexerFactory, "indexer", ResourceMapper, BulkResourceMapper)
|
: base(indexerFactory, "indexer", ResourceMapper, BulkResourceMapper)
|
||||||
{
|
{
|
||||||
|
SharedValidator.RuleFor(c => c.Priority).InclusiveBetween(1, 50);
|
||||||
SharedValidator.RuleFor(c => c.DownloadClientId).SetValidator(downloadClientExistsValidator);
|
SharedValidator.RuleFor(c => c.DownloadClientId).SetValidator(downloadClientExistsValidator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user