Fixed: Preferred word can't have a term that is empty or only spaces
This commit is contained in:
parent
642f75761f
commit
219494ea9d
|
@ -1,4 +1,5 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
using FluentValidation.Results;
|
using FluentValidation.Results;
|
||||||
using NzbDrone.Common.Extensions;
|
using NzbDrone.Common.Extensions;
|
||||||
|
@ -36,6 +37,11 @@ namespace Sonarr.Api.V3.Profiles.Release
|
||||||
{
|
{
|
||||||
context.AddFailure(nameof(ReleaseProfile.IndexerId), "Indexer does not exist");
|
context.AddFailure(nameof(ReleaseProfile.IndexerId), "Indexer does not exist");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (restriction.Preferred.Any(p => p.Key.IsNullOrWhiteSpace()))
|
||||||
|
{
|
||||||
|
context.AddFailure("Preferred", "Term cannot be empty or consist of only spaces");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue