empty string case should not be only for the contains case

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

@ -141,21 +141,22 @@ namespace NzbDrone.Api.Movie
}
if (pagingResource.FilterKey == "title")
{
if (pagingResource.FilterType == "contains")
{
if (pagingResource.FilterValue == string.Empty || pagingResource.FilterValue == null)
{
pagingSpec.FilterExpression = v => true;
}
else
{
if (pagingResource.FilterType == "contains")
{
pagingSpec.FilterExpression = v => v.CleanTitle.Contains(pagingResource.FilterValue);
}
} else
else
{
pagingSpec.FilterExpression = v => v.CleanTitle == pagingResource.FilterValue;
}
}
}
return ApplyToPage(_moviesService.Paged, pagingSpec, MovieResourceMapper.ToResource);

Loading…
Cancel
Save