mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
Merge branch 'master' into old-engine
This commit is contained in:
@@ -39,6 +39,7 @@ func SetupRoute(route *gin.RouterGroup) {
|
||||
route.GET("/playlist/*fname", playList)
|
||||
|
||||
route.GET("/download/:size", download)
|
||||
route.GET("/search/*query", rutorSearch)
|
||||
}
|
||||
|
||||
func shutdown(c *gin.Context) {
|
||||
|
||||
16
server/web/api/rutor.go
Normal file
16
server/web/api/rutor.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"server/rutor"
|
||||
"server/rutor/models"
|
||||
)
|
||||
|
||||
func rutorSearch(c *gin.Context) {
|
||||
query := c.Query("query")
|
||||
list := rutor.Search(query)
|
||||
if list == nil {
|
||||
list = []*models.TorrentDetails{}
|
||||
}
|
||||
c.JSON(200, list)
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package api
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"server/rutor"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/pkg/errors"
|
||||
@@ -11,7 +12,7 @@ import (
|
||||
"server/torr"
|
||||
)
|
||||
|
||||
//Action: get, set, def
|
||||
// Action: get, set, def
|
||||
type setsReqJS struct {
|
||||
requestI
|
||||
Sets *sets.BTSets `json:"sets,omitempty"`
|
||||
@@ -34,11 +35,14 @@ func settings(c *gin.Context) {
|
||||
if req.Sets.EnableDLNA {
|
||||
dlna.Start()
|
||||
}
|
||||
rutor.Stop()
|
||||
rutor.Start()
|
||||
c.Status(200)
|
||||
return
|
||||
} else if req.Action == "def" {
|
||||
torr.SetDefSettings()
|
||||
dlna.Stop()
|
||||
rutor.Stop()
|
||||
c.Status(200)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -118,20 +118,20 @@ var Manifesticon512maskablepng []byte
|
||||
//go:embed pages/site.webmanifest
|
||||
var Sitewebmanifest []byte
|
||||
|
||||
//go:embed pages/static/js/2.0f998e59.chunk.js
|
||||
var Staticjs20f998e59chunkjs []byte
|
||||
//go:embed pages/static/js/2.a86a4d53.chunk.js
|
||||
var Staticjs2a86a4d53chunkjs []byte
|
||||
|
||||
//go:embed pages/static/js/2.0f998e59.chunk.js.LICENSE.txt
|
||||
var Staticjs20f998e59chunkjsLICENSEtxt []byte
|
||||
//go:embed pages/static/js/2.a86a4d53.chunk.js.LICENSE.txt
|
||||
var Staticjs2a86a4d53chunkjsLICENSEtxt []byte
|
||||
|
||||
//go:embed pages/static/js/2.0f998e59.chunk.js.map
|
||||
var Staticjs20f998e59chunkjsmap []byte
|
||||
//go:embed pages/static/js/2.a86a4d53.chunk.js.map
|
||||
var Staticjs2a86a4d53chunkjsmap []byte
|
||||
|
||||
//go:embed pages/static/js/main.604c45f6.chunk.js
|
||||
var Staticjsmain604c45f6chunkjs []byte
|
||||
//go:embed pages/static/js/main.f534b9a4.chunk.js
|
||||
var Staticjsmainf534b9a4chunkjs []byte
|
||||
|
||||
//go:embed pages/static/js/main.604c45f6.chunk.js.map
|
||||
var Staticjsmain604c45f6chunkjsmap []byte
|
||||
//go:embed pages/static/js/main.f534b9a4.chunk.js.map
|
||||
var Staticjsmainf534b9a4chunkjsmap []byte
|
||||
|
||||
//go:embed pages/static/js/runtime-main.64d07802.js
|
||||
var Staticjsruntimemain64d07802js []byte
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
{
|
||||
"files": {
|
||||
"main.js": "/static/js/main.604c45f6.chunk.js",
|
||||
"main.js.map": "/static/js/main.604c45f6.chunk.js.map",
|
||||
"main.js": "/static/js/main.f534b9a4.chunk.js",
|
||||
"main.js.map": "/static/js/main.f534b9a4.chunk.js.map",
|
||||
"runtime-main.js": "/static/js/runtime-main.64d07802.js",
|
||||
"runtime-main.js.map": "/static/js/runtime-main.64d07802.js.map",
|
||||
"static/js/2.0f998e59.chunk.js": "/static/js/2.0f998e59.chunk.js",
|
||||
"static/js/2.0f998e59.chunk.js.map": "/static/js/2.0f998e59.chunk.js.map",
|
||||
"static/js/2.a86a4d53.chunk.js": "/static/js/2.a86a4d53.chunk.js",
|
||||
"static/js/2.a86a4d53.chunk.js.map": "/static/js/2.a86a4d53.chunk.js.map",
|
||||
"index.html": "/index.html",
|
||||
"static/js/2.0f998e59.chunk.js.LICENSE.txt": "/static/js/2.0f998e59.chunk.js.LICENSE.txt"
|
||||
"static/js/2.a86a4d53.chunk.js.LICENSE.txt": "/static/js/2.a86a4d53.chunk.js.LICENSE.txt"
|
||||
},
|
||||
"entrypoints": [
|
||||
"static/js/runtime-main.64d07802.js",
|
||||
"static/js/2.0f998e59.chunk.js",
|
||||
"static/js/main.604c45f6.chunk.js"
|
||||
"static/js/2.a86a4d53.chunk.js",
|
||||
"static/js/main.f534b9a4.chunk.js"
|
||||
]
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -161,24 +161,24 @@ func RouteWebPages(route *gin.RouterGroup) {
|
||||
c.Data(200, "application/manifest+json", Sitewebmanifest)
|
||||
})
|
||||
|
||||
route.GET("/static/js/2.0f998e59.chunk.js", func(c *gin.Context) {
|
||||
c.Data(200, "application/javascript; charset=utf-8", Staticjs20f998e59chunkjs)
|
||||
route.GET("/static/js/2.a86a4d53.chunk.js", func(c *gin.Context) {
|
||||
c.Data(200, "application/javascript; charset=utf-8", Staticjs2a86a4d53chunkjs)
|
||||
})
|
||||
|
||||
route.GET("/static/js/2.0f998e59.chunk.js.LICENSE.txt", func(c *gin.Context) {
|
||||
c.Data(200, "text/plain; charset=utf-8", Staticjs20f998e59chunkjsLICENSEtxt)
|
||||
route.GET("/static/js/2.a86a4d53.chunk.js.LICENSE.txt", func(c *gin.Context) {
|
||||
c.Data(200, "text/plain; charset=utf-8", Staticjs2a86a4d53chunkjsLICENSEtxt)
|
||||
})
|
||||
|
||||
route.GET("/static/js/2.0f998e59.chunk.js.map", func(c *gin.Context) {
|
||||
c.Data(200, "application/json", Staticjs20f998e59chunkjsmap)
|
||||
route.GET("/static/js/2.a86a4d53.chunk.js.map", func(c *gin.Context) {
|
||||
c.Data(200, "application/json", Staticjs2a86a4d53chunkjsmap)
|
||||
})
|
||||
|
||||
route.GET("/static/js/main.604c45f6.chunk.js", func(c *gin.Context) {
|
||||
c.Data(200, "application/javascript; charset=utf-8", Staticjsmain604c45f6chunkjs)
|
||||
route.GET("/static/js/main.f534b9a4.chunk.js", func(c *gin.Context) {
|
||||
c.Data(200, "application/javascript; charset=utf-8", Staticjsmainf534b9a4chunkjs)
|
||||
})
|
||||
|
||||
route.GET("/static/js/main.604c45f6.chunk.js.map", func(c *gin.Context) {
|
||||
c.Data(200, "application/json", Staticjsmain604c45f6chunkjsmap)
|
||||
route.GET("/static/js/main.f534b9a4.chunk.js.map", func(c *gin.Context) {
|
||||
c.Data(200, "application/json", Staticjsmainf534b9a4chunkjsmap)
|
||||
})
|
||||
|
||||
route.GET("/static/js/runtime-main.64d07802.js", func(c *gin.Context) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package web
|
||||
|
||||
import (
|
||||
"net"
|
||||
"server/rutor"
|
||||
"sort"
|
||||
|
||||
"github.com/gin-contrib/cors"
|
||||
@@ -37,6 +38,8 @@ func Start(port string) {
|
||||
waitChan <- err
|
||||
return
|
||||
}
|
||||
rutor.Start()
|
||||
|
||||
gin.SetMode(gin.ReleaseMode)
|
||||
|
||||
//corsCfg := cors.DefaultConfig()
|
||||
|
||||
Reference in New Issue
Block a user