cosmetics

This commit is contained in:
nikk gitanes
2024-06-14 01:48:01 +03:00
parent 8dfb5ea687
commit 8347510013

View File

@@ -172,11 +172,6 @@ func streamNoAuth(c *gin.Context) {
_, m3u := c.GetQuery("m3u") _, m3u := c.GetQuery("m3u")
_, fromlast := c.GetQuery("fromlast") _, fromlast := c.GetQuery("fromlast")
_, play := c.GetQuery("play") _, play := c.GetQuery("play")
title := c.Query("title")
poster := c.Query("poster")
category := c.Query("category")
data := ""
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"))
@@ -198,17 +193,22 @@ func streamNoAuth(c *gin.Context) {
return return
} }
title := c.Query("title")
if title == "" { if title == "" {
title = tor.Title title = tor.Title
} }
poster := c.Query("poster")
if poster == "" { if poster == "" {
poster = tor.Poster poster = tor.Poster
} }
category := c.Query("category")
if category == "" { if category == "" {
category = tor.Category category = tor.Category
} }
data = tor.Data data := tor.Data
if tor.Stat == state.TorrentInDB { if tor.Stat == state.TorrentInDB {
tor, err = torr.AddTorrent(spec, title, poster, data, category) tor, err = torr.AddTorrent(spec, title, poster, data, category)
@@ -241,7 +241,6 @@ func streamNoAuth(c *gin.Context) {
if preload { if preload {
torr.Preload(tor, index) torr.Preload(tor, index)
} }
// return m3u if query // return m3u if query
if m3u { if m3u {
name := strings.ReplaceAll(c.Param("fname"), `/`, "") // strip starting / from param name := strings.ReplaceAll(c.Param("fname"), `/`, "") // strip starting / from param