mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Various bug fixes (#2945)
* Only update fingerprints if changed * Fix panic when loading primary file fails * Fix gallery/scene association * Fix display of scene gallery in card * Use natural_cs collation with paths for title sorting
This commit is contained in:
@@ -989,13 +989,17 @@ func (qb *ImageStore) setImageSortAndPagination(q *queryBuilder, findFilter *mod
|
||||
)
|
||||
}
|
||||
|
||||
switch sort {
|
||||
case "path":
|
||||
addFilesJoin()
|
||||
addFolderJoin := func() {
|
||||
q.addJoins(join{
|
||||
table: folderTable,
|
||||
onClause: "files.parent_folder_id = folders.id",
|
||||
})
|
||||
}
|
||||
|
||||
switch sort {
|
||||
case "path":
|
||||
addFilesJoin()
|
||||
addFolderJoin()
|
||||
sortClause = " ORDER BY folders.path " + direction + ", files.basename " + direction
|
||||
case "file_count":
|
||||
sortClause = getCountSort(imageTable, imagesFilesTable, imageIDColumn, direction)
|
||||
@@ -1006,6 +1010,10 @@ func (qb *ImageStore) setImageSortAndPagination(q *queryBuilder, findFilter *mod
|
||||
case "mod_time", "filesize":
|
||||
addFilesJoin()
|
||||
sortClause = getSort(sort, direction, "files")
|
||||
case "title":
|
||||
addFilesJoin()
|
||||
addFolderJoin()
|
||||
sortClause = " ORDER BY images.title COLLATE NATURAL_CS " + direction + ", folders.path " + direction + ", files.basename COLLATE NATURAL_CS " + direction
|
||||
default:
|
||||
sortClause = getSort(sort, direction, "images")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user