From 5125f256fb8c20b902adafe16530c4792a580d87 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Thu, 20 Mar 2025 20:38:13 +0200 Subject: [PATCH] Fixed: Priority validation for indexers and download clients --- src/Prowlarr.Api.V1/DownloadClient/DownloadClientController.cs | 2 ++ src/Prowlarr.Api.V1/Indexers/IndexerController.cs | 1 + 2 files changed, 3 insertions(+) diff --git a/src/Prowlarr.Api.V1/DownloadClient/DownloadClientController.cs b/src/Prowlarr.Api.V1/DownloadClient/DownloadClientController.cs index dfaf24a9e..347c7e9c6 100644 --- a/src/Prowlarr.Api.V1/DownloadClient/DownloadClientController.cs +++ b/src/Prowlarr.Api.V1/DownloadClient/DownloadClientController.cs @@ -1,3 +1,4 @@ +using FluentValidation; using NzbDrone.Core.Download; using NzbDrone.SignalR; using Prowlarr.Http; @@ -13,6 +14,7 @@ namespace Prowlarr.Api.V1.DownloadClient public DownloadClientController(IBroadcastSignalRMessage signalRBroadcaster, IDownloadClientFactory downloadClientFactory) : base(signalRBroadcaster, downloadClientFactory, "downloadclient", ResourceMapper, BulkResourceMapper) { + SharedValidator.RuleFor(c => c.Priority).InclusiveBetween(1, 50); } } } diff --git a/src/Prowlarr.Api.V1/Indexers/IndexerController.cs b/src/Prowlarr.Api.V1/Indexers/IndexerController.cs index 6f360a574..07955299d 100644 --- a/src/Prowlarr.Api.V1/Indexers/IndexerController.cs +++ b/src/Prowlarr.Api.V1/Indexers/IndexerController.cs @@ -21,6 +21,7 @@ namespace Prowlarr.Api.V1.Indexers .ValidId() .SetValidator(appProfileExistsValidator); + SharedValidator.RuleFor(c => c.Priority).InclusiveBetween(1, 50); SharedValidator.RuleFor(c => c.DownloadClientId).SetValidator(downloadClientExistsValidator); } }