1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-05 10:32:35 +01:00

empty string case should not be only for the contains case

This commit is contained in:
geogolem 2017-03-02 15:21:39 -05:00
parent ff11388009
commit 7d394dcff2

View File

@ -140,21 +140,22 @@ private PagingResource<MovieResource> GetMoviePaged(PagingResource<MovieResource
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
pagingSpec.FilterExpression = v => true;
}
else
{
if (pagingResource.FilterType == "contains")
{
pagingSpec.FilterExpression = v => v.CleanTitle.Contains(pagingResource.FilterValue);
}
} else
{
pagingSpec.FilterExpression = v => v.CleanTitle == pagingResource.FilterValue;
else
{
pagingSpec.FilterExpression = v => v.CleanTitle == pagingResource.FilterValue;
}
}
}