From 7e0db2aad420dd8f28e4e77c3d9c7af09231a123 Mon Sep 17 00:00:00 2001 From: InfiniteTF Date: Mon, 1 Mar 2021 01:48:25 +0100 Subject: [PATCH] Change NULL filters to filter empty strings as well (#1137) --- pkg/sqlite/query.go | 4 ++++ ui/v2.5/src/components/Changelog/versions/v060.md | 1 + 2 files changed, 5 insertions(+) diff --git a/pkg/sqlite/query.go b/pkg/sqlite/query.go index 378fe0efe..a45ab4586 100644 --- a/pkg/sqlite/query.go +++ b/pkg/sqlite/query.go @@ -90,6 +90,10 @@ func (qb *queryBuilder) handleStringCriterionInput(c *models.StringCriterionInpu } qb.addWhere(column + " NOT regexp ?") qb.addArg(c.Value) + case models.CriterionModifierIsNull: + qb.addWhere("(" + column + " IS NULL OR TRIM(" + column + ") = '')") + case models.CriterionModifierNotNull: + qb.addWhere("(" + column + " IS NOT NULL AND TRIM(" + column + ") != '')") default: clause, count := getSimpleCriterionClause(modifier, "?") qb.addWhere(column + " " + clause) diff --git a/ui/v2.5/src/components/Changelog/versions/v060.md b/ui/v2.5/src/components/Changelog/versions/v060.md index bb453c598..2eb68aa9a 100644 --- a/ui/v2.5/src/components/Changelog/versions/v060.md +++ b/ui/v2.5/src/components/Changelog/versions/v060.md @@ -6,4 +6,5 @@ * Added Rescan button to scene, image, gallery details overflow button. ### 🐛 Bug fixes +* Change "Is NULL" filter to include empty string values. * Prevent scene card previews playing in full-screen on iOS devices.