This commit is contained in:
YouROK
2021-09-08 23:08:08 +03:00
parent fb60b02e84
commit 49caf0e42d
4 changed files with 23 additions and 10 deletions

View File

@@ -5,7 +5,6 @@ import (
"time"
"github.com/gin-gonic/gin"
sets "server/settings"
"server/torr"
)
@@ -38,11 +37,6 @@ func SetupRoute(route *gin.RouterGroup) {
route.GET("/playlistall/all.m3u", allPlayList)
route.GET("/playlist", playList)
route.GET("/playlist/*fname", playList)
route.GET("/msx/start.json", msxStart)
route.GET("/msx/torrents", msxTorrents)
route.GET("/msx/playlist", msxPlaylist)
route.GET("/msx/playlist/*fname", msxPlaylist)
}
func shutdown(c *gin.Context) {

View File

@@ -1,4 +1,4 @@
package api
package msx
import (
"fmt"
@@ -16,8 +16,11 @@ import (
)
type msxMenu struct {
Logo string `json:"logo,omitempty"`
Menu []msxMenuItem `json:"menu"`
Logo string `json:"logo,omitempty"`
Reuse bool `json:"reuse"`
Cache bool `json:"cache"`
Restore bool `json:"restore"`
Menu []msxMenuItem `json:"menu"`
}
type msxMenuItem struct {
@@ -76,7 +79,10 @@ func msxTorrents(c *gin.Context) {
}
c.JSON(200, msxMenu{
Logo: logo,
Logo: logo,
Cache: false,
Reuse: false,
Restore: false,
Menu: []msxMenuItem{
// Main page
{

10
server/web/msx/route.go Normal file
View File

@@ -0,0 +1,10 @@
package msx
import "github.com/gin-gonic/gin"
func SetupRoute(route *gin.RouterGroup) {
route.GET("/msx/start.json", msxStart)
route.GET("/msx/torrents", msxTorrents)
route.GET("/msx/playlist", msxPlaylist)
route.GET("/msx/playlist/*fname", msxPlaylist)
}

View File

@@ -8,6 +8,7 @@ import (
"github.com/gin-gonic/gin"
"server/dlna"
"server/settings"
"server/web/msx"
"server/log"
"server/torr"
@@ -48,9 +49,11 @@ func Start(port string) {
routeAuth := auth.SetupAuth(route)
if routeAuth != nil {
api.SetupRoute(routeAuth)
msx.SetupRoute(routeAuth)
pages.SetupRoute(routeAuth)
} else {
api.SetupRoute(&route.RouterGroup)
msx.SetupRoute(&route.RouterGroup)
pages.SetupRoute(&route.RouterGroup)
}
if settings.BTsets.EnableDLNA {