mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 08:26:00 +01:00
Filter by Studio (#6155)
This commit is contained in:
parent
a50a0d4289
commit
42f76ca34f
2 changed files with 5 additions and 0 deletions
|
|
@ -1096,6 +1096,7 @@ var sceneSortOptions = sortOptions{
|
||||||
"perceptual_similarity",
|
"perceptual_similarity",
|
||||||
"random",
|
"random",
|
||||||
"rating",
|
"rating",
|
||||||
|
"studio",
|
||||||
"tag_count",
|
"tag_count",
|
||||||
"title",
|
"title",
|
||||||
"updated_at",
|
"updated_at",
|
||||||
|
|
@ -1208,6 +1209,9 @@ func (qb *SceneStore) setSceneSort(query *queryBuilder, findFilter *models.FindF
|
||||||
query.sortAndPagination += fmt.Sprintf(" ORDER BY (SELECT MAX(o_date) FROM %s AS sort WHERE sort.%s = %s.id) %s", scenesODatesTable, sceneIDColumn, sceneTable, getSortDirection(direction))
|
query.sortAndPagination += fmt.Sprintf(" ORDER BY (SELECT MAX(o_date) FROM %s AS sort WHERE sort.%s = %s.id) %s", scenesODatesTable, sceneIDColumn, sceneTable, getSortDirection(direction))
|
||||||
case "o_counter":
|
case "o_counter":
|
||||||
query.sortAndPagination += getCountSort(sceneTable, scenesODatesTable, sceneIDColumn, direction)
|
query.sortAndPagination += getCountSort(sceneTable, scenesODatesTable, sceneIDColumn, direction)
|
||||||
|
case "studio":
|
||||||
|
query.join(studioTable, "", "scenes.studio_id = studios.id")
|
||||||
|
query.sortAndPagination += getSort("name", direction, studioTable)
|
||||||
default:
|
default:
|
||||||
query.sortAndPagination += getSort(sort, direction, "scenes")
|
query.sortAndPagination += getSort(sort, direction, "scenes")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@ const sortByOptions = [
|
||||||
"interactive",
|
"interactive",
|
||||||
"interactive_speed",
|
"interactive_speed",
|
||||||
"perceptual_similarity",
|
"perceptual_similarity",
|
||||||
|
"studio",
|
||||||
...MediaSortByOptions,
|
...MediaSortByOptions,
|
||||||
]
|
]
|
||||||
.map(ListFilterOptions.createSortBy)
|
.map(ListFilterOptions.createSortBy)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue