add rutor api

This commit is contained in:
YouROK
2023-01-29 20:04:48 +03:00
parent fbd1765331
commit ff1c05a6bf
6 changed files with 22 additions and 1 deletions

View File

@@ -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
}