From 7684ec222a9335e3c30fb46886c21331e9e1422e Mon Sep 17 00:00:00 2001 From: YouROK <8yourok8@mail.ru> Date: Fri, 12 Mar 2021 12:09:43 +0300 Subject: [PATCH] load torrent before send --- server/web/api/m3u.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/server/web/api/m3u.go b/server/web/api/m3u.go index 449a3c9..b108c54 100644 --- a/server/web/api/m3u.go +++ b/server/web/api/m3u.go @@ -51,9 +51,13 @@ func playList(c *gin.Context) { c.AbortWithStatus(http.StatusNotFound) return } - if !tor.WaitInfo() { - c.AbortWithError(http.StatusInternalServerError, errors.New("error get torrent info")) - return + + 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