New: Speed up API add by reworking SeriesExistsValidator
This commit is contained in:
parent
51d6fd32dc
commit
5638f9c0a1
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
using FluentValidation.Validators;
|
using FluentValidation.Validators;
|
||||||
using NzbDrone.Core.Tv;
|
using NzbDrone.Core.Tv;
|
||||||
|
|
||||||
|
@ -24,7 +25,7 @@ namespace NzbDrone.Core.Validation.Paths
|
||||||
|
|
||||||
var tvdbId = Convert.ToInt32(context.PropertyValue.ToString());
|
var tvdbId = Convert.ToInt32(context.PropertyValue.ToString());
|
||||||
|
|
||||||
return !_seriesService.GetAllSeries().Exists(s => s.TvdbId == tvdbId);
|
return !_seriesService.AllSeriesTvdbIds().Any(s => s == tvdbId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue