mirror of https://github.com/lidarr/Lidarr
Fixed: Preferred word can't have a term that is empty or only spaces
Fixes #1361 Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
This commit is contained in:
parent
474023378e
commit
37d294d168
|
@ -1,4 +1,5 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
using Lidarr.Http;
|
using Lidarr.Http;
|
||||||
using NzbDrone.Common.Extensions;
|
using NzbDrone.Common.Extensions;
|
||||||
|
@ -34,6 +35,11 @@ namespace Lidarr.Api.V1.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