New: Speed up Series Add by reworking SeriesPathValidator

This commit is contained in:
Qstick 2023-07-02 22:16:11 -05:00
parent 4304d80491
commit 51d6fd32dc
1 changed files with 3 additions and 2 deletions

View File

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