Fix Tags and People Filtering for NotContains (#2297)

This commit is contained in:
Cian Hannafin 2023-10-02 06:53:06 -05:00 committed by GitHub
parent c6947d9e15
commit bc64228f91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -358,7 +358,7 @@ public static class SeriesFilter
return queryable.Where(s => s.Metadata.Tags.Any(t => tags.Contains(t.Id)));
case FilterComparison.NotEqual:
case FilterComparison.NotContains:
return queryable.Where(s => s.Metadata.Tags.Any(t => !tags.Contains(t.Id)));
return queryable.Where(s => s.Metadata.Tags.All(t => !tags.Contains(t.Id)));
case FilterComparison.MustContains:
// Deconstruct and do a Union of a bunch of where statements since this doesn't translate
var queries = new List<IQueryable<Series>>()
@ -397,7 +397,7 @@ public static class SeriesFilter
return queryable.Where(s => s.Metadata.People.Any(p => people.Contains(p.Id)));
case FilterComparison.NotEqual:
case FilterComparison.NotContains:
return queryable.Where(s => s.Metadata.People.Any(t => !people.Contains(t.Id)));
return queryable.Where(s => s.Metadata.People.All(t => !people.Contains(t.Id)));
case FilterComparison.MustContains:
// Deconstruct and do a Union of a bunch of where statements since this doesn't translate
var queries = new List<IQueryable<Series>>()