update msx doc

This commit is contained in:
nikk gitanes
2024-02-03 22:50:19 +03:00
parent 963c7dab32
commit 97b7f527ff
4 changed files with 63 additions and 63 deletions

View File

@@ -148,32 +148,6 @@ const docTemplate = `{
} }
} }
}, },
"/msx": {
"get": {
"description": "Multi usage endpoint.",
"produces": [
"application/json"
],
"tags": [
"MSX"
],
"summary": "Multi usage endpoint",
"parameters": [
{
"type": "string",
"description": "Magnet/hash/link to torrent",
"name": "link",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "Data returned according to query"
}
}
}
},
"/msx/imdb": { "/msx/imdb": {
"get": { "get": {
"description": "Get MSX IMDB informations.", "description": "Get MSX IMDB informations.",
@@ -191,7 +165,7 @@ const docTemplate = `{
} }
} }
}, },
"/msx/imdb/:id": { "/msx/imdb/{id}": {
"get": { "get": {
"description": "Get MSX IMDB informations.", "description": "Get MSX IMDB informations.",
"produces": [ "produces": [
@@ -217,6 +191,32 @@ const docTemplate = `{
} }
} }
}, },
"/msx/{pth}": {
"get": {
"description": "Multi usage endpoint.",
"produces": [
"application/json"
],
"tags": [
"MSX"
],
"summary": "Multi usage endpoint",
"parameters": [
{
"type": "string",
"description": "Route MSX pages",
"name": "link",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Data returned according to path"
}
}
}
},
"/play/{hash}/{id}": { "/play/{hash}/{id}": {
"get": { "get": {
"description": "Play given torrent referenced by hash.", "description": "Play given torrent referenced by hash.",

View File

@@ -141,32 +141,6 @@
} }
} }
}, },
"/msx": {
"get": {
"description": "Multi usage endpoint.",
"produces": [
"application/json"
],
"tags": [
"MSX"
],
"summary": "Multi usage endpoint",
"parameters": [
{
"type": "string",
"description": "Magnet/hash/link to torrent",
"name": "link",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "Data returned according to query"
}
}
}
},
"/msx/imdb": { "/msx/imdb": {
"get": { "get": {
"description": "Get MSX IMDB informations.", "description": "Get MSX IMDB informations.",
@@ -184,7 +158,7 @@
} }
} }
}, },
"/msx/imdb/:id": { "/msx/imdb/{id}": {
"get": { "get": {
"description": "Get MSX IMDB informations.", "description": "Get MSX IMDB informations.",
"produces": [ "produces": [
@@ -210,6 +184,32 @@
} }
} }
}, },
"/msx/{pth}": {
"get": {
"description": "Multi usage endpoint.",
"produces": [
"application/json"
],
"tags": [
"MSX"
],
"summary": "Multi usage endpoint",
"parameters": [
{
"type": "string",
"description": "Route MSX pages",
"name": "link",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Data returned according to path"
}
}
}
},
"/play/{hash}/{id}": { "/play/{hash}/{id}": {
"get": { "get": {
"description": "Play given torrent referenced by hash.", "description": "Play given torrent referenced by hash.",

View File

@@ -393,12 +393,12 @@ paths:
summary: Get HTML of magnet links summary: Get HTML of magnet links
tags: tags:
- Pages - Pages
/msx: /msx/{pth}:
get: get:
description: Multi usage endpoint. description: Multi usage endpoint.
parameters: parameters:
- description: Magnet/hash/link to torrent - description: Route MSX pages
in: query in: path
name: link name: link
required: true required: true
type: string type: string
@@ -406,7 +406,7 @@ paths:
- application/json - application/json
responses: responses:
"200": "200":
description: Data returned according to query description: Data returned according to path
summary: Multi usage endpoint summary: Multi usage endpoint
tags: tags:
- MSX - MSX
@@ -421,7 +421,7 @@ paths:
summary: Get MSX IMDB informations summary: Get MSX IMDB informations
tags: tags:
- MSX - MSX
/msx/imdb/:id: /msx/imdb/{id}:
get: get:
description: Get MSX IMDB informations. description: Get MSX IMDB informations.
parameters: parameters:

View File

@@ -43,11 +43,11 @@ func SetupRoute(r *gin.RouterGroup) {
// //
// @Tags MSX // @Tags MSX
// //
// @Param link query string true "Magnet/hash/link to torrent" // @Param link path string true "Route MSX pages"
// //
// @Produce json // @Produce json
// @Success 200 "Data returned according to query" // @Success 200 "Data returned according to path"
// @Router /msx [get] // @Router /msx/{pth} [get]
func msxPTH(c *gin.Context) { func msxPTH(c *gin.Context) {
js := []string{"http://msx.benzac.de/js/tvx-plugin.min.js"} js := []string{"http://msx.benzac.de/js/tvx-plugin.min.js"}
switch p := c.Param("pth"); p { switch p := c.Param("pth"); p {
@@ -114,7 +114,7 @@ func msxIMDB(c *gin.Context) {
// //
// @Produce json // @Produce json
// @Success 200 "JSON MSX IMDB informations" // @Success 200 "JSON MSX IMDB informations"
// @Router /msx/imdb/:id [get] // @Router /msx/imdb/{id} [get]
func msxIMDBID(c *gin.Context) { func msxIMDBID(c *gin.Context) {
idb.Lock() idb.Lock()
defer idb.Unlock() defer idb.Unlock()