cosmetics

This commit is contained in:
nikk gitanes
2024-04-12 05:12:51 +03:00
parent ecce45695b
commit b4e6281c5c
8 changed files with 46 additions and 49 deletions

View File

@@ -466,15 +466,13 @@ const docTemplate = `{
"type": "string",
"description": "Set title of torrent",
"name": "title",
"in": "query",
"required": true
"in": "query"
},
{
"type": "string",
"description": "Set poster link of torrent",
"name": "poster",
"in": "query",
"required": true
"in": "query"
},
{
"type": "string",

View File

@@ -459,15 +459,13 @@
"type": "string",
"description": "Set title of torrent",
"name": "title",
"in": "query",
"required": true
"in": "query"
},
{
"type": "string",
"description": "Set poster link of torrent",
"name": "poster",
"in": "query",
"required": true
"in": "query"
},
{
"type": "string",

View File

@@ -603,12 +603,10 @@ paths:
- description: Set title of torrent
in: query
name: title
required: true
type: string
- description: Set poster link of torrent
in: query
name: poster
required: true
type: string
- description: 'Set category of torrent, used in web: movie, tv, music, other'
in: query

View File

@@ -43,8 +43,8 @@ import (
// @Param m3u query string false "Get torrent as M3U playlist"
// @Param fromlast query string false "Get M3U from last played file"
// @Param play query string false "Start stream torrent"
// @Param title query string true "Set title of torrent"
// @Param poster query string true "Set poster link of torrent"
// @Param title query string false "Set title of torrent"
// @Param poster query string false "Set poster link of torrent"
// @Param category query string false "Set category of torrent, used in web: movie, tv, music, other"
//
// @Produce application/octet-stream
@@ -61,9 +61,10 @@ func stream(c *gin.Context) {
_, play := c.GetQuery("play")
title := c.Query("title")
poster := c.Query("poster")
category, _ := c.GetQuery("category")
category := c.Query("category")
data := ""
notAuth := c.GetBool("auth_required") && c.GetString(gin.AuthUserKey) == ""
if notAuth && (play || m3u) {
@@ -81,9 +82,10 @@ func stream(c *gin.Context) {
return
}
title, _ = url.QueryUnescape(title)
link, _ = url.QueryUnescape(link)
title, _ = url.QueryUnescape(title)
poster, _ = url.QueryUnescape(poster)
category, _ = url.QueryUnescape(category)
spec, err := utils.ParseLink(link)
if err != nil {
@@ -172,9 +174,10 @@ func streamNoAuth(c *gin.Context) {
_, play := c.GetQuery("play")
title := c.Query("title")
poster := c.Query("poster")
data := ""
category := c.Query("category")
data := ""
if link == "" {
c.AbortWithError(http.StatusBadRequest, errors.New("link should not be empty"))
return

View File

@@ -118,20 +118,20 @@ var Mstile150x150png []byte
//go:embed pages/site.webmanifest
var Sitewebmanifest []byte
//go:embed pages/static/js/2.63f74d95.chunk.js
var Staticjs263f74d95chunkjs []byte
//go:embed pages/static/js/2.15e75e72.chunk.js
var Staticjs215e75e72chunkjs []byte
//go:embed pages/static/js/2.63f74d95.chunk.js.LICENSE.txt
var Staticjs263f74d95chunkjsLICENSEtxt []byte
//go:embed pages/static/js/2.15e75e72.chunk.js.LICENSE.txt
var Staticjs215e75e72chunkjsLICENSEtxt []byte
//go:embed pages/static/js/2.63f74d95.chunk.js.map
var Staticjs263f74d95chunkjsmap []byte
//go:embed pages/static/js/2.15e75e72.chunk.js.map
var Staticjs215e75e72chunkjsmap []byte
//go:embed pages/static/js/main.96201d04.chunk.js
var Staticjsmain96201d04chunkjs []byte
//go:embed pages/static/js/main.714fb205.chunk.js
var Staticjsmain714fb205chunkjs []byte
//go:embed pages/static/js/main.96201d04.chunk.js.map
var Staticjsmain96201d04chunkjsmap []byte
//go:embed pages/static/js/main.714fb205.chunk.js.map
var Staticjsmain714fb205chunkjsmap []byte
//go:embed pages/static/js/runtime-main.f542387e.js
var Staticjsruntimemainf542387ejs []byte

View File

@@ -1,17 +1,17 @@
{
"files": {
"main.js": "/static/js/main.96201d04.chunk.js",
"main.js.map": "/static/js/main.96201d04.chunk.js.map",
"main.js": "/static/js/main.714fb205.chunk.js",
"main.js.map": "/static/js/main.714fb205.chunk.js.map",
"runtime-main.js": "/static/js/runtime-main.f542387e.js",
"runtime-main.js.map": "/static/js/runtime-main.f542387e.js.map",
"static/js/2.63f74d95.chunk.js": "/static/js/2.63f74d95.chunk.js",
"static/js/2.63f74d95.chunk.js.map": "/static/js/2.63f74d95.chunk.js.map",
"static/js/2.15e75e72.chunk.js": "/static/js/2.15e75e72.chunk.js",
"static/js/2.15e75e72.chunk.js.map": "/static/js/2.15e75e72.chunk.js.map",
"index.html": "/index.html",
"static/js/2.63f74d95.chunk.js.LICENSE.txt": "/static/js/2.63f74d95.chunk.js.LICENSE.txt"
"static/js/2.15e75e72.chunk.js.LICENSE.txt": "/static/js/2.15e75e72.chunk.js.LICENSE.txt"
},
"entrypoints": [
"static/js/runtime-main.f542387e.js",
"static/js/2.63f74d95.chunk.js",
"static/js/main.96201d04.chunk.js"
"static/js/2.15e75e72.chunk.js",
"static/js/main.714fb205.chunk.js"
]
}

File diff suppressed because one or more lines are too long

View File

@@ -280,46 +280,46 @@ func RouteWebPages(route gin.IRouter) {
c.Data(200, "application/manifest+json", Sitewebmanifest)
})
route.GET("/static/js/2.63f74d95.chunk.js", func(c *gin.Context) {
etag := fmt.Sprintf("%x", md5.Sum(Staticjs263f74d95chunkjs))
route.GET("/static/js/2.15e75e72.chunk.js", func(c *gin.Context) {
etag := fmt.Sprintf("%x", md5.Sum(Staticjs215e75e72chunkjs))
c.Header("Cache-Control", "public, max-age=31536000")
c.Header("ETag", etag)
c.Data(200, "text/javascript; charset=utf-8", Staticjs263f74d95chunkjs)
c.Data(200, "application/javascript; charset=utf-8", Staticjs215e75e72chunkjs)
})
route.GET("/static/js/2.63f74d95.chunk.js.LICENSE.txt", func(c *gin.Context) {
etag := fmt.Sprintf("%x", md5.Sum(Staticjs263f74d95chunkjsLICENSEtxt))
route.GET("/static/js/2.15e75e72.chunk.js.LICENSE.txt", func(c *gin.Context) {
etag := fmt.Sprintf("%x", md5.Sum(Staticjs215e75e72chunkjsLICENSEtxt))
c.Header("Cache-Control", "public, max-age=31536000")
c.Header("ETag", etag)
c.Data(200, "text/plain; charset=utf-8", Staticjs263f74d95chunkjsLICENSEtxt)
c.Data(200, "text/plain; charset=utf-8", Staticjs215e75e72chunkjsLICENSEtxt)
})
route.GET("/static/js/2.63f74d95.chunk.js.map", func(c *gin.Context) {
etag := fmt.Sprintf("%x", md5.Sum(Staticjs263f74d95chunkjsmap))
route.GET("/static/js/2.15e75e72.chunk.js.map", func(c *gin.Context) {
etag := fmt.Sprintf("%x", md5.Sum(Staticjs215e75e72chunkjsmap))
c.Header("Cache-Control", "public, max-age=31536000")
c.Header("ETag", etag)
c.Data(200, "application/json", Staticjs263f74d95chunkjsmap)
c.Data(200, "application/json", Staticjs215e75e72chunkjsmap)
})
route.GET("/static/js/main.96201d04.chunk.js", func(c *gin.Context) {
etag := fmt.Sprintf("%x", md5.Sum(Staticjsmain96201d04chunkjs))
route.GET("/static/js/main.714fb205.chunk.js", func(c *gin.Context) {
etag := fmt.Sprintf("%x", md5.Sum(Staticjsmain714fb205chunkjs))
c.Header("Cache-Control", "public, max-age=31536000")
c.Header("ETag", etag)
c.Data(200, "text/javascript; charset=utf-8", Staticjsmain96201d04chunkjs)
c.Data(200, "application/javascript; charset=utf-8", Staticjsmain714fb205chunkjs)
})
route.GET("/static/js/main.96201d04.chunk.js.map", func(c *gin.Context) {
etag := fmt.Sprintf("%x", md5.Sum(Staticjsmain96201d04chunkjsmap))
route.GET("/static/js/main.714fb205.chunk.js.map", func(c *gin.Context) {
etag := fmt.Sprintf("%x", md5.Sum(Staticjsmain714fb205chunkjsmap))
c.Header("Cache-Control", "public, max-age=31536000")
c.Header("ETag", etag)
c.Data(200, "application/json", Staticjsmain96201d04chunkjsmap)
c.Data(200, "application/json", Staticjsmain714fb205chunkjsmap)
})
route.GET("/static/js/runtime-main.f542387e.js", func(c *gin.Context) {
etag := fmt.Sprintf("%x", md5.Sum(Staticjsruntimemainf542387ejs))
c.Header("Cache-Control", "public, max-age=31536000")
c.Header("ETag", etag)
c.Data(200, "text/javascript; charset=utf-8", Staticjsruntimemainf542387ejs)
c.Data(200, "application/javascript; charset=utf-8", Staticjsruntimemainf542387ejs)
})
route.GET("/static/js/runtime-main.f542387e.js.map", func(c *gin.Context) {