From 2982118ef8a8ff36fa9e946edb6fd4a04fc00b12 Mon Sep 17 00:00:00 2001 From: akuma06 Date: Sat, 2 Sep 2017 02:22:27 +0200 Subject: [PATCH] Fix broken sub category search Fix #1428 --- utils/search/torrentParam.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/search/torrentParam.go b/utils/search/torrentParam.go index 5c1b00e1..839e4da9 100644 --- a/utils/search/torrentParam.go +++ b/utils/search/torrentParam.go @@ -342,7 +342,9 @@ func (p *TorrentParam) FindES(c *gin.Context, client *elastic.Client) ([]models. func (p *TorrentParam) toDBQuery(c *gin.Context) *Query { query := &Query{} - query.Append(p.Category.ToDBQuery()) + sql, cats := p.Category.ToDBQuery() + query.Append(sql, cats...) + if len(p.Languages) > 0 { query.Append("language "+searchOperator, "%"+langsToDBQuery(p.Languages)+"%") }