This commit is contained in:
YouROK
2020-11-10 22:57:16 +03:00
parent 6a11651cf5
commit 1ce27ef121
12 changed files with 63 additions and 32 deletions

View File

@@ -3,13 +3,14 @@ package api
import (
"net/http"
"github.com/anacrolix/torrent/metainfo"
"github.com/gin-gonic/gin"
"github.com/pkg/errors"
"server/log"
"server/torr"
"server/torr/state"
"server/web/api/utils"
"github.com/anacrolix/torrent/metainfo"
"github.com/gin-gonic/gin"
"github.com/pkg/errors"
)
//Action: add, get, rem, list, drop
@@ -70,7 +71,7 @@ func addTorrent(req torrReqJS, c *gin.Context) {
return
}
if !torr.WaitInfo() {
if !torr.GotInfo() {
log.TLogln("error add torrent:", "timeout connection torrent")
c.AbortWithError(http.StatusNotFound, errors.New("timeout connection torrent"))
return