fix up index error and update travis deployment
Cette révision appartient à :
Parent
ad91fc909f
révision
e6abfc4df5
2 fichiers modifiés avec 8 ajouts et 6 suppressions
|
@ -1,18 +1,15 @@
|
|||
language: go
|
||||
|
||||
go:
|
||||
- 1.x
|
||||
|
||||
install:
|
||||
- go get github.com/gorilla/mux
|
||||
- go get github.com/mattn/go-sqlite3
|
||||
- go get github.com/jinzhu/gorm
|
||||
- go build
|
||||
|
||||
deploy:
|
||||
provider: releases
|
||||
api_key:
|
||||
secure: jMeiHFBLXNsdrbVcuPY2yY84jJE7Th7xwSo7PaeDTPATo+W3SpPXpNi1VHjh+mwIg69rK7fF8EIDWXGsTApUib8UrXZj9mIJu154fn3LyPa07EWVgD874sFIYat2rxfuvJT3pK+nX7j3Gpj7HAGgiRGWmDq6LdA/ETOk2KDBdqeSpHTHSVGqHX5y6hA+z8tTQa/S8g4Ujb/coEDjT2umdQznUJjxoFjpOD0cyoCTv7tVho8qPC72FoSNGXb4C4EnjfxQRp/okNWJTHdTRSva9TstC/+u0oy7qEcpnNLm7OTHmBL53hbWcoiE3T60FObUiRgB7JA5SrC05P3s/nVLoFk2g1pQvDfR1pgHCIFqQZhcg/Y6XaxdP1U34RdvknoxflR7xZ9j+DNg14IcljAfcidpMZh459Ur/XU1kCXrY/lbAyA9PE48XWLHg/FXAPmbDpaHp3U0rPeRFrm6hfnNKL14TV2hL5oFMpTCNzrQwrsGMf2ROMk9u/j7FQSGKQyOcyt2HCgEZCKYAq+aUtp0cg4EVhhWYQFtuU5TOoWaYH7HDPCVIkSUpwAbwlGoOcK/WVRJatZQjZwS5zLJ6J2Vq+ekMu5wstTlInau4sRwOoU8SOJPxx1+XQMM9KX7G3H3ico/ZqKZNoKytaqHrRPfI8EX2R1ADLg5o9wCfWRofOQ=
|
||||
secure: Nz2M3ZbQumKGVga/nnZnz1VXikRkGoLXk5FoH4uOl6GF6rlUNmtvJYs34LWF0/CMswBXNhjCggEaMMtZC+j66ZjoAdHBXRfrOb6jisNJRF6FNk7Kob6W3itCEOTvEL/8a+k2fI95cLqOXDLR2tIX03nchb8rDmVALs7P4gQgy2Y7UAo/aa/0G+OhsSJrlQWt0MT9OKGoIXpeKZjOG3wO/YwqfDwRTItuA9DLFoMQ0gwQfgT58t1ullbpM+jISni7rwfK+jUnZHjUH/VHLguVFmL4A1DxWriJXNOrZR+i/eUJ94mWvfI08WR8Qh3UCr58FrKoWvPsu7HnCq0bn6RvQtCKqx5zgv+R+kxKIP+79SVjKZUi1ghswAuwx9+AT6vHgPLXjJLpZj9Ap/KhfnQR6VT3jBT+kEpmv3J+57JcJCyD4ZslT+LGW2ul0uWoGCVVMBdHqMzuC8OSxpKCw6bFNWnLq+JAU08zlJkAAllBKev+LZWiF8GBICKfynRgViy+MKNaMfzIUNlL9UDskaiWP+BL9RXGLJ2FVdeKkzqdAYdYlgdJChQ56KTtRukR7FlOqDXhszIPxJhU9wn9lNXmGvq1FJyo1LRY3HX+5o9lWw+enaswNxFxdLBMXPhF5jehMkImiR4/YS4WdlmHcEfsli9sBOjBQh1iIpCfme77PPU=
|
||||
file: nyaa
|
||||
skip_cleanup: true
|
||||
overwrite: true
|
||||
|
|
9
main.go
9
main.go
|
@ -96,8 +96,13 @@ func searchHandler(w http.ResponseWriter, r *http.Request) {
|
|||
pagenum, _ := strconv.Atoi(html.EscapeString(page))
|
||||
searchQuery := r.URL.Query().Get("q")
|
||||
cat := r.URL.Query().Get("c")
|
||||
searchCatId := html.EscapeString(strings.Split(cat, "_")[0])
|
||||
searchSubCatId := html.EscapeString(strings.Split(cat, "_")[1])
|
||||
catsSplit := strings.Split(cat, "-")
|
||||
// need this to prevent out of index panics
|
||||
var searchCatId, searchSubCatId string
|
||||
if len(catsSplit) == 2 {
|
||||
searchCatId = html.EscapeString(catsSplit[0])
|
||||
searchSubCatId = html.EscapeString(catsSplit[1])
|
||||
}
|
||||
|
||||
nbTorrents := 0
|
||||
|
||||
|
|
Référencer dans un nouveau ticket