mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Add O-counter (#334)
* Add backend support for o-counter * Add o-counter buttons everywhere * Put o-counter button right-aligned on tabs * Add o-counter filter
This commit is contained in:
@@ -95,7 +95,7 @@ func getSort(sort string, direction string, tableName string) string {
|
||||
|
||||
const randomSeedPrefix = "random_"
|
||||
|
||||
if strings.Contains(sort, "_count") {
|
||||
if strings.HasSuffix(sort, "_count") {
|
||||
var relationTableName = strings.Split(sort, "_")[0] // TODO: pluralize?
|
||||
colName := getColumn(relationTableName, "id")
|
||||
return " ORDER BY COUNT(distinct " + colName + ") " + direction
|
||||
|
||||
Reference in New Issue
Block a user