mirror of
https://github.com/stashapp/stash.git
synced 2026-04-17 20:42:26 +02:00
FR: Sort Scenes and Images by Resolution (#6441)
This commit is contained in:
parent
09ba41b2bb
commit
956af44a29
4 changed files with 21 additions and 1 deletions
|
|
@ -942,6 +942,7 @@ var imageSortOptions = sortOptions{
|
|||
"performer_count",
|
||||
"random",
|
||||
"rating",
|
||||
"resolution",
|
||||
"tag_count",
|
||||
"title",
|
||||
"updated_at",
|
||||
|
|
@ -1001,6 +1002,14 @@ func (qb *ImageStore) setImageSortAndPagination(q *queryBuilder, findFilter *mod
|
|||
case "mod_time", "filesize":
|
||||
addFilesJoin()
|
||||
sortClause = getSort(sort, direction, "files")
|
||||
case "resolution":
|
||||
addFilesJoin()
|
||||
q.addJoins(join{
|
||||
sort: true,
|
||||
table: imageFileTable,
|
||||
onClause: "images_files.file_id = image_files.file_id",
|
||||
})
|
||||
sortClause = " ORDER BY MIN(image_files.width, image_files.height) " + direction
|
||||
case "title":
|
||||
addFilesJoin()
|
||||
addFolderJoin()
|
||||
|
|
|
|||
|
|
@ -1138,6 +1138,7 @@ var sceneSortOptions = sortOptions{
|
|||
"perceptual_similarity",
|
||||
"random",
|
||||
"rating",
|
||||
"resolution",
|
||||
"studio",
|
||||
"tag_count",
|
||||
"title",
|
||||
|
|
@ -1236,6 +1237,9 @@ func (qb *SceneStore) setSceneSort(query *queryBuilder, findFilter *models.FindF
|
|||
sort = "frame_rate"
|
||||
addVideoFileTable()
|
||||
query.sortAndPagination += getSort(sort, direction, videoFileTable)
|
||||
case "resolution":
|
||||
addVideoFileTable()
|
||||
query.sortAndPagination += fmt.Sprintf(" ORDER BY MIN(%s.width, %s.height) %s", videoFileTable, videoFileTable, getSortDirection(direction))
|
||||
case "filesize":
|
||||
addFileTable()
|
||||
query.sortAndPagination += getSort(sort, direction, fileTable)
|
||||
|
|
|
|||
|
|
@ -25,7 +25,13 @@ import { GalleriesCriterionOption } from "./criteria/galleries";
|
|||
|
||||
const defaultSortBy = "path";
|
||||
|
||||
const sortByOptions = ["filesize", "file_count", "date", ...MediaSortByOptions]
|
||||
const sortByOptions = [
|
||||
"filesize",
|
||||
"file_count",
|
||||
"date",
|
||||
"resolution",
|
||||
...MediaSortByOptions,
|
||||
]
|
||||
.map(ListFilterOptions.createSortBy)
|
||||
.concat([
|
||||
{
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ const sortByOptions = [
|
|||
"filesize",
|
||||
"duration",
|
||||
"framerate",
|
||||
"resolution",
|
||||
"bitrate",
|
||||
"last_played_at",
|
||||
"resume_time",
|
||||
|
|
|
|||
Loading…
Reference in a new issue