Fixed: Priority validation for indexers and download clients

This commit is contained in:
Bogdan
2025-03-20 20:38:13 +02:00
parent b99e8d0d65
commit 5125f256fb
2 changed files with 3 additions and 0 deletions

View File

@@ -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);
}
}
}

View File

@@ -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);
}
}