Correct title ordering for objects without titles (#3244)

* Correct scene title ordering
* Correct ordering for other objects
* Add basename function, add to gallery title sort
This commit is contained in:
WithoutPants
2022-12-09 08:29:34 +11:00
committed by GitHub
parent 78bb2d8425
commit eb7956a05a
7 changed files with 17 additions and 3 deletions

View File

@@ -1446,7 +1446,7 @@ func (qb *SceneStore) setSceneSort(query *queryBuilder, findFilter *models.FindF
case "title":
addFileTable()
addFolderTable()
query.sortAndPagination += " ORDER BY scenes.title COLLATE NATURAL_CS " + direction + ", folders.path " + direction + ", files.basename COLLATE NATURAL_CS " + direction
query.sortAndPagination += " ORDER BY COALESCE(scenes.title, files.basename) COLLATE NATURAL_CS " + direction + ", folders.path " + direction
case "play_count":
// handle here since getSort has special handling for _count suffix
query.sortAndPagination += " ORDER BY scenes.play_count " + direction