From 51d6fd32dc03d1248caa229b707721f114983a01 Mon Sep 17 00:00:00 2001 From: Qstick Date: Sun, 2 Jul 2023 22:16:11 -0500 Subject: [PATCH] New: Speed up Series Add by reworking SeriesPathValidator --- src/NzbDrone.Core/Validation/Paths/SeriesPathValidator.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core/Validation/Paths/SeriesPathValidator.cs b/src/NzbDrone.Core/Validation/Paths/SeriesPathValidator.cs index 80ce3541a..66f2f7689 100644 --- a/src/NzbDrone.Core/Validation/Paths/SeriesPathValidator.cs +++ b/src/NzbDrone.Core/Validation/Paths/SeriesPathValidator.cs @@ -1,4 +1,5 @@ -using FluentValidation.Validators; +using System.Linq; +using FluentValidation.Validators; using NzbDrone.Common.Extensions; using NzbDrone.Core.Tv; @@ -27,7 +28,7 @@ namespace NzbDrone.Core.Validation.Paths dynamic instance = context.ParentContext.InstanceToValidate; var instanceId = (int)instance.Id; - return !_seriesService.GetAllSeries().Exists(s => s.Path.PathEquals(context.PropertyValue.ToString()) && s.Id != instanceId); + return !_seriesService.GetAllSeriesPaths().Any(s => s.Value.PathEquals(context.PropertyValue.ToString()) && s.Key != instanceId); } } }