From 6c0d08de56ceccb8070b8328250831961fae19c6 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Thu, 6 Jun 2024 12:09:39 +0300 Subject: [PATCH] Fixed: Ignore case for name validation in providers (cherry picked from commit 0edc5ba99a15c5f80305b387a053f35fc3f6e51b) --- src/Prowlarr.Api.V1/ProviderControllerBase.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Prowlarr.Api.V1/ProviderControllerBase.cs b/src/Prowlarr.Api.V1/ProviderControllerBase.cs index 324a50972..ba1ccf553 100644 --- a/src/Prowlarr.Api.V1/ProviderControllerBase.cs +++ b/src/Prowlarr.Api.V1/ProviderControllerBase.cs @@ -3,6 +3,7 @@ using System.Linq; using FluentValidation; using FluentValidation.Results; using Microsoft.AspNetCore.Mvc; +using NzbDrone.Common.Extensions; using NzbDrone.Core.ThingiProvider; using NzbDrone.Core.Validation; using NzbDrone.Http.REST.Attributes; @@ -31,7 +32,7 @@ namespace Prowlarr.Api.V1 _bulkResourceMapper = bulkResourceMapper; SharedValidator.RuleFor(c => c.Name).NotEmpty(); - SharedValidator.RuleFor(c => c.Name).Must((v, c) => !_providerFactory.All().Any(p => p.Name == c && p.Id != v.Id)).WithMessage("Should be unique"); + SharedValidator.RuleFor(c => c.Name).Must((v, c) => !_providerFactory.All().Any(p => p.Name.EqualsIgnoreCase(c) && p.Id != v.Id)).WithMessage("Should be unique"); SharedValidator.RuleFor(c => c.Implementation).NotEmpty(); SharedValidator.RuleFor(c => c.ConfigContract).NotEmpty();