Change NULL filters to filter empty strings as well (#1137)

This commit is contained in:
InfiniteTF 2021-03-01 01:48:25 +01:00 committed by GitHub
parent 144cd6e4f2
commit 7e0db2aad4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -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)

View File

@ -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.