empty string case should not be only for the contains case

pull/2/head
geogolem 8 years ago
parent ff11388009
commit 7d394dcff2

@ -140,21 +140,22 @@ namespace NzbDrone.Api.Movie
pagingSpec.FilterExpression = v => v.MovieFileId == 0; pagingSpec.FilterExpression = v => v.MovieFileId == 0;
} }
if (pagingResource.FilterKey == "title") if (pagingResource.FilterKey == "title")
{ {
if (pagingResource.FilterType == "contains") if (pagingResource.FilterValue == string.Empty || pagingResource.FilterValue == null)
{ {
if (pagingResource.FilterValue == string.Empty || pagingResource.FilterValue == null) pagingSpec.FilterExpression = v => true;
}
else
{
if (pagingResource.FilterType == "contains")
{ {
pagingSpec.FilterExpression = v => true; pagingSpec.FilterExpression = v => v.CleanTitle.Contains(pagingResource.FilterValue);
} }
else else
{ {
pagingSpec.FilterExpression = v => v.CleanTitle.Contains(pagingResource.FilterValue); pagingSpec.FilterExpression = v => v.CleanTitle == pagingResource.FilterValue;
} }
} else
{
pagingSpec.FilterExpression = v => v.CleanTitle == pagingResource.FilterValue;
} }
} }

Loading…
Cancel
Save