mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Add (not) between modifiers for number criterion (#1559)
* Add (not) between modifiers for number criterion * Extract list filters into dedicated components Extract the filters from the AddFiltersDialog into custom components. This allows for further refactorring where components will be bound to criterions. * Add placeholders to number and duration criterions * Add backwards compatibility for saved filters Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
@@ -135,11 +135,9 @@ func (qb *queryBuilder) addFilter(f *filterBuilder) {
|
||||
|
||||
func (qb *queryBuilder) handleIntCriterionInput(c *models.IntCriterionInput, column string) {
|
||||
if c != nil {
|
||||
clause, count := getIntCriterionWhereClause(column, *c)
|
||||
clause, args := getIntCriterionWhereClause(column, *c)
|
||||
qb.addWhere(clause)
|
||||
if count == 1 {
|
||||
qb.addArg(c.Value)
|
||||
}
|
||||
qb.addArg(args...)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,12 +190,9 @@ func (qb *queryBuilder) handleStringCriterionInput(c *models.StringCriterionInpu
|
||||
|
||||
func (qb *queryBuilder) handleCountCriterion(countFilter *models.IntCriterionInput, primaryTable, joinTable, primaryFK string) {
|
||||
if countFilter != nil {
|
||||
clause, count := getCountCriterionClause(primaryTable, joinTable, primaryFK, *countFilter)
|
||||
|
||||
if count == 1 {
|
||||
qb.addArg(countFilter.Value)
|
||||
}
|
||||
clause, args := getCountCriterionClause(primaryTable, joinTable, primaryFK, *countFilter)
|
||||
|
||||
qb.addWhere(clause)
|
||||
qb.addArg(args...)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user