Add max search limit
Cette révision appartient à :
Parent
e59501cc4f
révision
023baccf5b
1 fichiers modifiés avec 12 ajouts et 9 suppressions
|
@ -1,11 +1,11 @@
|
|||
package search
|
||||
|
||||
import(
|
||||
import (
|
||||
"github.com/ewhal/nyaa/model"
|
||||
"github.com/ewhal/nyaa/service/torrent"
|
||||
"github.com/ewhal/nyaa/util/log"
|
||||
"net/http"
|
||||
"html"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
@ -25,6 +25,9 @@ func SearchByQuery(r *http.Request, pagenum int) (SearchParam, []model.Torrents,
|
|||
maxPerPage = 50 // default Value maxPerPage
|
||||
}
|
||||
|
||||
if maxPerPage > 300 {
|
||||
maxPerPage = 300
|
||||
}
|
||||
search_param := SearchParam{}
|
||||
search_param.Max = maxPerPage
|
||||
search_param.Query = r.URL.Query().Get("q")
|
||||
|
|
Référencer dans un nouveau ticket