From fd9e4b3ec2cf1a4da576a99c052fe2dd607a8433 Mon Sep 17 00:00:00 2001 From: dogwithakeyboard <128322708+dogwithakeyboard@users.noreply.github.com> Date: Sun, 22 Sep 2024 04:20:33 +0100 Subject: [PATCH] add table alias to group scene sort (#5279) --- pkg/sqlite/scene.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/sqlite/scene.go b/pkg/sqlite/scene.go index c950be4d1..5df614b88 100644 --- a/pkg/sqlite/scene.go +++ b/pkg/sqlite/scene.go @@ -1128,9 +1128,12 @@ func (qb *SceneStore) setSceneSort(query *queryBuilder, findFilter *models.FindF direction := findFilter.GetDirection() switch sort { - case "movie_scene_number", "group_scene_number": + case "movie_scene_number": query.join(groupsScenesTable, "", "scenes.id = groups_scenes.scene_id") query.sortAndPagination += getSort("scene_index", direction, groupsScenesTable) + case "group_scene_number": + query.join(groupsScenesTable, "scene_group", "scenes.id = scene_group.scene_id") + query.sortAndPagination += getSort("scene_index", direction, "scene_group") case "tag_count": query.sortAndPagination += getCountSort(sceneTable, scenesTagsTable, sceneIDColumn, direction) case "performer_count":