diff --git a/server/docs/docs.go b/server/docs/docs.go index 61cfc26..b2c4f5b 100644 --- a/server/docs/docs.go +++ b/server/docs/docs.go @@ -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": { "get": { "description": "Get MSX IMDB informations.", @@ -191,7 +165,7 @@ const docTemplate = `{ } } }, - "/msx/imdb/:id": { + "/msx/imdb/{id}": { "get": { "description": "Get MSX IMDB informations.", "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}": { "get": { "description": "Play given torrent referenced by hash.", diff --git a/server/docs/swagger.json b/server/docs/swagger.json index b653dec..52ef964 100644 --- a/server/docs/swagger.json +++ b/server/docs/swagger.json @@ -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": { "get": { "description": "Get MSX IMDB informations.", @@ -184,7 +158,7 @@ } } }, - "/msx/imdb/:id": { + "/msx/imdb/{id}": { "get": { "description": "Get MSX IMDB informations.", "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}": { "get": { "description": "Play given torrent referenced by hash.", diff --git a/server/docs/swagger.yaml b/server/docs/swagger.yaml index a185378..fe094f3 100644 --- a/server/docs/swagger.yaml +++ b/server/docs/swagger.yaml @@ -393,12 +393,12 @@ paths: summary: Get HTML of magnet links tags: - Pages - /msx: + /msx/{pth}: get: description: Multi usage endpoint. parameters: - - description: Magnet/hash/link to torrent - in: query + - description: Route MSX pages + in: path name: link required: true type: string @@ -406,7 +406,7 @@ paths: - application/json responses: "200": - description: Data returned according to query + description: Data returned according to path summary: Multi usage endpoint tags: - MSX @@ -421,7 +421,7 @@ paths: summary: Get MSX IMDB informations tags: - MSX - /msx/imdb/:id: + /msx/imdb/{id}: get: description: Get MSX IMDB informations. parameters: diff --git a/server/web/msx/msx.go b/server/web/msx/msx.go index 6e0ff56..d5a74e2 100644 --- a/server/web/msx/msx.go +++ b/server/web/msx/msx.go @@ -43,11 +43,11 @@ func SetupRoute(r *gin.RouterGroup) { // // @Tags MSX // -// @Param link query string true "Magnet/hash/link to torrent" +// @Param link path string true "Route MSX pages" // // @Produce json -// @Success 200 "Data returned according to query" -// @Router /msx [get] +// @Success 200 "Data returned according to path" +// @Router /msx/{pth} [get] func msxPTH(c *gin.Context) { js := []string{"http://msx.benzac.de/js/tvx-plugin.min.js"} switch p := c.Param("pth"); p { @@ -114,7 +114,7 @@ func msxIMDB(c *gin.Context) { // // @Produce json // @Success 200 "JSON MSX IMDB informations" -// @Router /msx/imdb/:id [get] +// @Router /msx/imdb/{id} [get] func msxIMDBID(c *gin.Context) { idb.Lock() defer idb.Unlock()