From a6b8a3f2e88c5c9e2835020942792c71a11f3371 Mon Sep 17 00:00:00 2001 From: bnkai <48220860+bnkai@users.noreply.github.com> Date: Sat, 16 Nov 2019 00:12:47 +0200 Subject: [PATCH] Make sort filter queries for name case insensitive (#183) --- pkg/models/querybuilder_sql.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/models/querybuilder_sql.go b/pkg/models/querybuilder_sql.go index b3f75c2af..686b59e70 100644 --- a/pkg/models/querybuilder_sql.go +++ b/pkg/models/querybuilder_sql.go @@ -114,6 +114,10 @@ func getSort(sort string, direction string, tableName string) string { } else if tableName == "scene_markers" { additional = ", scene_markers.scene_id ASC, scene_markers.seconds ASC" } + if strings.Compare(sort, "name") == 0 { + return " ORDER BY " + colName + " COLLATE NOCASE " + direction + additional + } + return " ORDER BY " + colName + " " + direction + additional } }