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,10 +51,14 @@ func playList(c *gin.Context) {
c.AbortWithStatus(http.StatusNotFound)
return
}
if !tor.WaitInfo() {
if tor.Stat == state.TorrentInDB {
tor = torr.LoadTorrent(tor)
if tor == nil {
c.AbortWithError(http.StatusInternalServerError, errors.New("error get torrent info"))
return
}
}
host := "http://" + c.Request.Host
list := getM3uList(tor.Status(), host, fromlast)