From c5fed1bbdcec190d3bec0f01cb81f8662d57a6f7 Mon Sep 17 00:00:00 2001 From: bnkai <48220860+bnkai@users.noreply.github.com> Date: Fri, 28 May 2021 02:01:03 +0300 Subject: [PATCH] Fix sort by movies_scene_number (#1448) --- pkg/sqlite/scene.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/sqlite/scene.go b/pkg/sqlite/scene.go index 802d55d12..8d13a7080 100644 --- a/pkg/sqlite/scene.go +++ b/pkg/sqlite/scene.go @@ -673,7 +673,7 @@ func (qb *sceneQueryBuilder) setSceneSort(query *queryBuilder, findFilter *model direction := findFilter.GetDirection() switch sort { case "movie_scene_number": - query.join(moviesScenesTable, "movies_join", "scenes.id") + query.join(moviesScenesTable, "movies_join", "scenes.id = movies_join.scene_id") query.sortAndPagination += fmt.Sprintf(" ORDER BY movies_join.scene_index %s", getSortDirection(direction)) case "tag_count": query.sortAndPagination += getCountSort(sceneTable, scenesTagsTable, sceneIDColumn, direction)