mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-20 05:56:10 +05:00
creating...
This commit is contained in:
@@ -1,12 +1,9 @@
|
|||||||
package api
|
package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/anacrolix/missinggo/httptoo"
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"server/torr"
|
"server/torr"
|
||||||
@@ -21,6 +18,10 @@ func stream(c *gin.Context) {
|
|||||||
_, save := c.GetQuery("save")
|
_, save := c.GetQuery("save")
|
||||||
_, m3u := c.GetQuery("m3u")
|
_, m3u := c.GetQuery("m3u")
|
||||||
_, play := c.GetQuery("play")
|
_, play := c.GetQuery("play")
|
||||||
|
title := c.Query("title")
|
||||||
|
poster := c.Query("poster")
|
||||||
|
|
||||||
|
// TODO unescape args
|
||||||
|
|
||||||
if link == "" {
|
if link == "" {
|
||||||
c.AbortWithError(http.StatusBadRequest, errors.New("link should not be empty"))
|
c.AbortWithError(http.StatusBadRequest, errors.New("link should not be empty"))
|
||||||
@@ -57,6 +58,10 @@ func stream(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tor.Title = title
|
||||||
|
tor.Poster = poster
|
||||||
|
|
||||||
// save to db
|
// save to db
|
||||||
if save {
|
if save {
|
||||||
utils.AddTorrent(tor)
|
utils.AddTorrent(tor)
|
||||||
|
|||||||
Reference in New Issue
Block a user