mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Sort case insensitive, date by newest first (#3560)
* Case insensitive search * Fix not adding extra sort when no sort specified. * Using newer version of fvbommel/sortorder package
This commit is contained in:
@@ -893,20 +893,23 @@ func (qb *PerformerStore) getPerformerSort(findFilter *models.FindFilterType) st
|
||||
direction = findFilter.GetDirection()
|
||||
}
|
||||
|
||||
if sort == "tag_count" {
|
||||
return getCountSort(performerTable, performersTagsTable, performerIDColumn, direction)
|
||||
}
|
||||
if sort == "scenes_count" {
|
||||
return getCountSort(performerTable, performersScenesTable, performerIDColumn, direction)
|
||||
}
|
||||
if sort == "images_count" {
|
||||
return getCountSort(performerTable, performersImagesTable, performerIDColumn, direction)
|
||||
}
|
||||
if sort == "galleries_count" {
|
||||
return getCountSort(performerTable, performersGalleriesTable, performerIDColumn, direction)
|
||||
sortQuery := ""
|
||||
switch sort {
|
||||
case "tag_count":
|
||||
sortQuery += getCountSort(performerTable, performersTagsTable, performerIDColumn, direction)
|
||||
case "scenes_count":
|
||||
sortQuery += getCountSort(performerTable, performersScenesTable, performerIDColumn, direction)
|
||||
case "images_count":
|
||||
sortQuery += getCountSort(performerTable, performersImagesTable, performerIDColumn, direction)
|
||||
case "galleries_count":
|
||||
sortQuery += getCountSort(performerTable, performersGalleriesTable, performerIDColumn, direction)
|
||||
default:
|
||||
sortQuery += getSort(sort, direction, "performers")
|
||||
}
|
||||
|
||||
return getSort(sort, direction, "performers")
|
||||
// Whatever the sorting, always use name/id as a final sort
|
||||
sortQuery += ", COALESCE(performers.name, performers.id) COLLATE NATURAL_CI ASC"
|
||||
return sortQuery
|
||||
}
|
||||
|
||||
func (qb *PerformerStore) tagsRepository() *joinRepository {
|
||||
|
||||
Reference in New Issue
Block a user