Skip to content

Commit 4fa1185

Browse files
author
dularion
committed
Fix Dash search for accents #799
1 parent 83cf100 commit 4fa1185

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

grails-app/controllers/streama/DashController.groovy

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,20 @@ class DashController {
111111

112112
def searchMedia() {
113113
String query = params.query
114-
def movies = Movie.findAllByDeletedNotEqual(true)
115-
def shows = TvShow.findAllByDeletedNotEqual(true)
116114

115+
def movies = Movie.where{
116+
deleted != true
117+
title =~ "%${query}%"
118+
}.list()
119+
120+
def tvShows = TvShow.where{
121+
deleted != true
122+
name =~ "%${query}%"
123+
}.list()
117124

118125
def result = [
119-
shows:shows.findAll{it.name.toLowerCase().contains(query.toLowerCase())},
120-
movies:movies.findAll{it.title.toLowerCase().contains(query.toLowerCase())}
126+
shows: tvShows,
127+
movies: movies
121128
]
122129
respond result
123130
}

0 commit comments

Comments
 (0)