From c95eaccc578675063d196b17dc178a05d303be02 Mon Sep 17 00:00:00 2001 From: YouROK <8yourok8@mail.ru> Date: Mon, 9 Nov 2020 17:07:44 +0300 Subject: [PATCH] creating... --- src/server/web/api/stream.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/server/web/api/stream.go b/src/server/web/api/stream.go index 0824ac6..8aa559b 100644 --- a/src/server/web/api/stream.go +++ b/src/server/web/api/stream.go @@ -1,12 +1,9 @@ package api import ( - "fmt" "net/http" "strconv" - "strings" - "github.com/anacrolix/missinggo/httptoo" "github.com/gin-gonic/gin" "github.com/pkg/errors" "server/torr" @@ -21,6 +18,10 @@ func stream(c *gin.Context) { _, save := c.GetQuery("save") _, m3u := c.GetQuery("m3u") _, play := c.GetQuery("play") + title := c.Query("title") + poster := c.Query("poster") + + // TODO unescape args if link == "" { c.AbortWithError(http.StatusBadRequest, errors.New("link should not be empty")) @@ -57,6 +58,10 @@ func stream(c *gin.Context) { return } } + + tor.Title = title + tor.Poster = poster + // save to db if save { utils.AddTorrent(tor)