Fixed: Priority validation for indexers and download clients

(cherry picked from commit f0e320f3aa501f120721503b8256f464a31be783)
pull/4370/merge
Bogdan 1 month ago
parent 18f13fe7f8
commit 950c51bc59

@ -1,3 +1,4 @@
using FluentValidation;
using Lidarr.Http;
using NzbDrone.Core.Download;
@ -12,6 +13,7 @@ namespace Lidarr.Api.V1.DownloadClient
public DownloadClientController(IDownloadClientFactory downloadClientFactory)
: base(downloadClientFactory, "downloadclient", ResourceMapper, BulkResourceMapper)
{
SharedValidator.RuleFor(c => c.Priority).InclusiveBetween(1, 50);
}
}
}

@ -1,3 +1,4 @@
using FluentValidation;
using Lidarr.Http;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Validation;
@ -13,6 +14,7 @@ namespace Lidarr.Api.V1.Indexers
public IndexerController(IndexerFactory indexerFactory, DownloadClientExistsValidator downloadClientExistsValidator)
: base(indexerFactory, "indexer", ResourceMapper, BulkResourceMapper)
{
SharedValidator.RuleFor(c => c.Priority).InclusiveBetween(1, 50);
SharedValidator.RuleFor(c => c.DownloadClientId).SetValidator(downloadClientExistsValidator);
}
}

Loading…
Cancel
Save