mirror of
https://github.com/Sonarr/Sonarr.git
synced 2025-04-25 06:47:09 -04:00
Fixed: Preferred word can't have a term that is empty or only spaces
This commit is contained in:
parent
642f75761f
commit
219494ea9d
1 changed files with 6 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue