Fixed: Priority validation for indexers and download clients

This commit is contained in:
Bogdan 2025-03-20 13:10:06 +02:00 committed by Mark McDowall
parent 9f29b06ca4
commit f0e320f3aa
2 changed files with 4 additions and 0 deletions

View file

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

View file

@ -1,3 +1,4 @@
using FluentValidation;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Validation;
using NzbDrone.SignalR;
@ -16,6 +17,7 @@ namespace Sonarr.Api.V3.Indexers
DownloadClientExistsValidator downloadClientExistsValidator)
: base(signalRBroadcaster, indexerFactory, "indexer", ResourceMapper, BulkResourceMapper)
{
SharedValidator.RuleFor(c => c.Priority).InclusiveBetween(1, 50);
SharedValidator.RuleFor(c => c.DownloadClientId).SetValidator(downloadClientExistsValidator);
}
}