616c6b1c62
Release Docker multi arch / docker (push) Has been cancelled
Test Install Script / Test Script Syntax (push) Has been cancelled
Test Install Script / Test on almalinux-10 (default) (push) Has been cancelled
Test Install Script / Test on almalinux-10 (root) (push) Has been cancelled
Test Install Script / Test on almalinux-8 (default) (push) Has been cancelled
Test Install Script / Test on almalinux-8 (root) (push) Has been cancelled
Test Install Script / Test on almalinux-9 (default) (push) Has been cancelled
Test Install Script / Test on almalinux-9 (root) (push) Has been cancelled
Test Install Script / Test on amazonlinux-2 (default) (push) Has been cancelled
Test Install Script / Test on amazonlinux-2 (root) (push) Has been cancelled
Test Install Script / Test on debian-11 (default) (push) Has been cancelled
Test Install Script / Test on debian-11 (root) (push) Has been cancelled
Test Install Script / Test on debian-12 (default) (push) Has been cancelled
Test Install Script / Test on debian-12 (root) (push) Has been cancelled
Test Install Script / Test on debian-13 (default) (push) Has been cancelled
Test Install Script / Test on debian-13 (root) (push) Has been cancelled
Test Install Script / Test on fedora-latest (default) (push) Has been cancelled
Test Install Script / Test on fedora-latest (root) (push) Has been cancelled
Test Install Script / Test on rocky-10 (default) (push) Has been cancelled
Test Install Script / Test on rocky-10 (root) (push) Has been cancelled
Test Install Script / Test on rocky-8 (default) (push) Has been cancelled
Test Install Script / Test on rocky-8 (root) (push) Has been cancelled
Test Install Script / Test on rocky-9 (default) (push) Has been cancelled
Test Install Script / Test on rocky-9 (root) (push) Has been cancelled
Test Install Script / Test on ubuntu-22.04 (default) (push) Has been cancelled
Test Install Script / Test on ubuntu-22.04 (root) (push) Has been cancelled
Test Install Script / Test on ubuntu-24.04 (default) (push) Has been cancelled
Test Install Script / Test on ubuntu-24.04 (root) (push) Has been cancelled
68 lines
1.5 KiB
Go
68 lines
1.5 KiB
Go
package api
|
|
|
|
import (
|
|
config "server/settings"
|
|
"server/web/auth"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
type requestI struct {
|
|
Action string `json:"action,omitempty"`
|
|
}
|
|
|
|
func SetupRoute(route gin.IRouter) {
|
|
authorized := route.Group("/", auth.CheckAuth())
|
|
|
|
authorized.GET("/shutdown", shutdown)
|
|
authorized.GET("/shutdown/*reason", shutdown)
|
|
|
|
authorized.POST("/settings", settings)
|
|
authorized.POST("/torznab/test", torznabTest)
|
|
|
|
authorized.POST("/torrents", torrents)
|
|
|
|
authorized.POST("/torrent/upload", torrentUpload)
|
|
|
|
authorized.POST("/cache", cache)
|
|
|
|
route.HEAD("/stream", stream)
|
|
route.GET("/stream", stream)
|
|
|
|
route.HEAD("/stream/*fname", stream)
|
|
route.GET("/stream/*fname", stream)
|
|
|
|
route.HEAD("/play/:hash/:id", play)
|
|
route.GET("/play/:hash/:id", play)
|
|
|
|
authorized.POST("/viewed", viewed)
|
|
|
|
authorized.GET("/playlistall/all.m3u", allPlayList)
|
|
|
|
route.GET("/playlist", playList)
|
|
route.GET("/playlist/*fname", playList)
|
|
|
|
authorized.GET("/download/:size", download)
|
|
|
|
if config.SearchWA {
|
|
route.GET("/search/*query", rutorSearch)
|
|
} else {
|
|
authorized.GET("/search/*query", rutorSearch)
|
|
}
|
|
|
|
if config.SearchWA {
|
|
route.GET("/torznab/search/*query", torznabSearch)
|
|
} else {
|
|
authorized.GET("/torznab/search/*query", torznabSearch)
|
|
}
|
|
|
|
// Add storage settings endpoints
|
|
authorized.GET("/storage/settings", GetStorageSettings)
|
|
authorized.POST("/storage/settings", UpdateStorageSettings)
|
|
|
|
// Add TMDB settings endpoint
|
|
authorized.GET("/tmdb/settings", tmdbSettings)
|
|
|
|
authorized.GET("/ffp/:hash/:id", ffp)
|
|
}
|