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)