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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user