This commit is contained in:
2021-07-25 10:15:28 +02:00
parent ebb55eb0dc
commit 6b4267b50b
2 changed files with 9 additions and 2 deletions

View File

@ -44,9 +44,11 @@ func getVideoHandlers() {
likes = iota
random = iota
names = iota
length = iota
)
var SortClause string
// if wrong number passed no sorting is performed
var SortClause = ""
switch args.Sort {
case date:
SortClause = "ORDER BY create_date DESC, movie_name"
@ -60,6 +62,9 @@ func getVideoHandlers() {
case names:
SortClause = "ORDER BY movie_name"
break
case length:
SortClause = "ORDER BY length DESC"
break
}
var query string