New: Speed up Series Add by reworking SeriesPathValidator
This commit is contained in:
parent
4304d80491
commit
51d6fd32dc
|
@ -1,4 +1,5 @@
|
||||||
using FluentValidation.Validators;
|
using System.Linq;
|
||||||
|
using FluentValidation.Validators;
|
||||||
using NzbDrone.Common.Extensions;
|
using NzbDrone.Common.Extensions;
|
||||||
using NzbDrone.Core.Tv;
|
using NzbDrone.Core.Tv;
|
||||||
|
|
||||||
|
@ -27,7 +28,7 @@ namespace NzbDrone.Core.Validation.Paths
|
||||||
dynamic instance = context.ParentContext.InstanceToValidate;
|
dynamic instance = context.ParentContext.InstanceToValidate;
|
||||||
var instanceId = (int)instance.Id;
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue