1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00

Better way to fix empty string split results

This commit is contained in:
Mark McDowall 2014-01-15 16:22:22 -08:00
parent 885872ff3a
commit 6cbc8687de

View File

@ -37,12 +37,10 @@ public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase sear
return true;
}
var restrictions = restrictionsString.Split('\n');
var restrictions = restrictionsString.Split(new []{ '\n' }, StringSplitOptions.RemoveEmptyEntries);
foreach (var restriction in restrictions)
{
if (String.IsNullOrWhiteSpace(restriction)) continue;
if (subject.Release.Title.ToLowerInvariant().Contains(restriction.ToLowerInvariant()))
{
_logger.Trace("{0} is restricted: {1}", subject, restriction);