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:
@@ -414,16 +414,21 @@ func (qb *studioQueryBuilder) getStudioSort(findFilter *models.FindFilterType) s
|
||||
direction = findFilter.GetDirection()
|
||||
}
|
||||
|
||||
sortQuery := ""
|
||||
switch sort {
|
||||
case "scenes_count":
|
||||
return getCountSort(studioTable, sceneTable, studioIDColumn, direction)
|
||||
sortQuery += getCountSort(studioTable, sceneTable, studioIDColumn, direction)
|
||||
case "images_count":
|
||||
return getCountSort(studioTable, imageTable, studioIDColumn, direction)
|
||||
sortQuery += getCountSort(studioTable, imageTable, studioIDColumn, direction)
|
||||
case "galleries_count":
|
||||
return getCountSort(studioTable, galleryTable, studioIDColumn, direction)
|
||||
sortQuery += getCountSort(studioTable, galleryTable, studioIDColumn, direction)
|
||||
default:
|
||||
return getSort(sort, direction, "studios")
|
||||
sortQuery += getSort(sort, direction, "studios")
|
||||
}
|
||||
|
||||
// Whatever the sorting, always use name/id as a final sort
|
||||
sortQuery += ", COALESCE(studios.name, studios.id) COLLATE NATURAL_CI ASC"
|
||||
return sortQuery
|
||||
}
|
||||
|
||||
func (qb *studioQueryBuilder) queryStudio(ctx context.Context, query string, args []interface{}) (*models.Studio, error) {
|
||||
|
||||
Reference in New Issue
Block a user