diff --git a/src/Lidarr.Api.V1/DownloadClient/DownloadClientController.cs b/src/Lidarr.Api.V1/DownloadClient/DownloadClientController.cs index bd4c993bf..bc54aa7e0 100644 --- a/src/Lidarr.Api.V1/DownloadClient/DownloadClientController.cs +++ b/src/Lidarr.Api.V1/DownloadClient/DownloadClientController.cs @@ -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); } } } diff --git a/src/Lidarr.Api.V1/Indexers/IndexerController.cs b/src/Lidarr.Api.V1/Indexers/IndexerController.cs index 2ebcd3f29..2187e2b28 100644 --- a/src/Lidarr.Api.V1/Indexers/IndexerController.cs +++ b/src/Lidarr.Api.V1/Indexers/IndexerController.cs @@ -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); } }