From 141ff1c769e8b2cedd2522433a027075ba350a48 Mon Sep 17 00:00:00 2001 From: ayame-git Date: Wed, 3 May 2017 14:11:16 +0300 Subject: [PATCH] maybe now? --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 2e0d7d86..6fea47cd 100644 --- a/main.go +++ b/main.go @@ -53,7 +53,7 @@ func apiHandler(w http.ResponseWriter, r *http.Request) { page := vars["page"] pagenum, _ := strconv.Atoi(html.EscapeString(page)) b := Record{Records: []Records{}} - rows, err := dbHandle.Query("select torrent_id, torrent_name, status_id, torrent_hash from torrents ORDER BY torrent_id DESC LIMIT 50 offset ?", 50*pagenum-1) + rows, err := dbHandle.Query("select torrent_id, torrent_name, status_id, torrent_hash from torrents ORDER BY torrent_id DESC LIMIT 50 offset ?", 50*(pagenum-1)) for rows.Next() { var id, name, hash, magnet string var status int @@ -157,7 +157,7 @@ func rootHandler(w http.ResponseWriter, r *http.Request) { page := vars["page"] pagenum, _ := strconv.Atoi(html.EscapeString(page)) b := Record{Category: "_", Records: []Records{}} - rows, err := dbHandle.Query("select torrent_id, torrent_name, status_id, torrent_hash from torrents ORDER BY torrent_id DESC LIMIT 50 offset ?", 50*pagenum-1) + rows, err := dbHandle.Query("select torrent_id, torrent_name, status_id, torrent_hash from torrents ORDER BY torrent_id DESC LIMIT 50 offset ?", 50*(pagenum-1)) for rows.Next() { var id, name, hash, magnet string var status int