From 19f6433829c5bef0cb697f08bf9359e4a1b57da3 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Mon, 3 Jul 2023 11:36:22 +0300 Subject: [PATCH] New: Speed up API add by reworking ArtistExistsValidator Co-authored-by: Qstick --- src/NzbDrone.Core/Validation/Paths/ArtistExistsValidator.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/Validation/Paths/ArtistExistsValidator.cs b/src/NzbDrone.Core/Validation/Paths/ArtistExistsValidator.cs index 138f444c3..041ffd360 100644 --- a/src/NzbDrone.Core/Validation/Paths/ArtistExistsValidator.cs +++ b/src/NzbDrone.Core/Validation/Paths/ArtistExistsValidator.cs @@ -21,7 +21,9 @@ namespace NzbDrone.Core.Validation.Paths return true; } - return !_artistService.GetAllArtists().Exists(s => s.Metadata.Value.ForeignArtistId == context.PropertyValue.ToString()); + var foreignArtistId = context.PropertyValue.ToString(); + + return _artistService.FindById(foreignArtistId) == null; } } }