load torrent before send

This commit is contained in:
YouROK
2021-03-12 12:09:43 +03:00
parent 91d71201f6
commit 7684ec222a

View File

@@ -51,9 +51,13 @@ func playList(c *gin.Context) {
c.AbortWithStatus(http.StatusNotFound) c.AbortWithStatus(http.StatusNotFound)
return return
} }
if !tor.WaitInfo() {
c.AbortWithError(http.StatusInternalServerError, errors.New("error get torrent info")) if tor.Stat == state.TorrentInDB {
return tor = torr.LoadTorrent(tor)
if tor == nil {
c.AbortWithError(http.StatusInternalServerError, errors.New("error get torrent info"))
return
}
} }
host := "http://" + c.Request.Host host := "http://" + c.Request.Host