search normal and unidecoded cols when searching
This commit is contained in:
@@ -166,7 +166,8 @@ func (c *Controller) SearchTwo(w http.ResponseWriter, r *http.Request) {
|
||||
// search "artists"
|
||||
var artists []*model.Album
|
||||
c.DB.
|
||||
Where("parent_id = 1 AND right_path_u_dec LIKE ?", query).
|
||||
Where("parent_id = 1 "+
|
||||
"AND (right_path || right_path_u_dec) LIKE ?", query).
|
||||
Offset(getIntParamOr(r, "artistOffset", 0)).
|
||||
Limit(getIntParamOr(r, "artistCount", 20)).
|
||||
Find(&artists)
|
||||
@@ -178,7 +179,8 @@ func (c *Controller) SearchTwo(w http.ResponseWriter, r *http.Request) {
|
||||
// search "albums"
|
||||
var albums []*model.Album
|
||||
c.DB.
|
||||
Where("tag_artist_id IS NOT NULL AND right_path_u_dec LIKE ?", query).
|
||||
Where("tag_artist_id IS NOT NULL "+
|
||||
"AND (right_path || right_path_u_dec) LIKE ?", query).
|
||||
Offset(getIntParamOr(r, "albumOffset", 0)).
|
||||
Limit(getIntParamOr(r, "albumCount", 20)).
|
||||
Find(&albums)
|
||||
@@ -190,7 +192,7 @@ func (c *Controller) SearchTwo(w http.ResponseWriter, r *http.Request) {
|
||||
var tracks []*model.Track
|
||||
c.DB.
|
||||
Preload("Album").
|
||||
Where("filename_u_dec LIKE ?", query).
|
||||
Where("(filename || filename_u_dec) LIKE ?", query).
|
||||
Offset(getIntParamOr(r, "songOffset", 0)).
|
||||
Limit(getIntParamOr(r, "songCount", 20)).
|
||||
Find(&tracks)
|
||||
|
||||
Reference in New Issue
Block a user