mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Add scene/image/gallery popover count buttons for performer/studio/tag cards (#1293)
* Add counts to graphql schema * Add count resolvers and query refactor * Add count popover buttons
This commit is contained in:
@@ -234,7 +234,7 @@ func (r *repository) querySimple(query string, args []interface{}, out interface
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *repository) executeFindQuery(body string, args []interface{}, sortAndPagination string, whereClauses []string, havingClauses []string) ([]int, int, error) {
|
||||
func (r *repository) buildQueryBody(body string, whereClauses []string, havingClauses []string) string {
|
||||
if len(whereClauses) > 0 {
|
||||
body = body + " WHERE " + strings.Join(whereClauses, " AND ") // TODO handle AND or OR
|
||||
}
|
||||
@@ -243,6 +243,12 @@ func (r *repository) executeFindQuery(body string, args []interface{}, sortAndPa
|
||||
body = body + " HAVING " + strings.Join(havingClauses, " AND ") // TODO handle AND or OR
|
||||
}
|
||||
|
||||
return body
|
||||
}
|
||||
|
||||
func (r *repository) executeFindQuery(body string, args []interface{}, sortAndPagination string, whereClauses []string, havingClauses []string) ([]int, int, error) {
|
||||
body = r.buildQueryBody(body, whereClauses, havingClauses)
|
||||
|
||||
countQuery := r.buildCountQuery(body)
|
||||
idsQuery := body + sortAndPagination
|
||||
|
||||
|
||||
Reference in New Issue
Block a user