remove qiwi from donate links and fix ts icon

also we have a reason
This commit is contained in:
nikk gitanes
2024-06-12 22:46:50 +03:00
parent b6328d6153
commit b44493c6c9
8 changed files with 45 additions and 40 deletions

View File

@@ -15,18 +15,20 @@ 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("/torrents", torrents)
authorized.POST("/torrent/upload", torrentUpload)
authorized.POST("/cache", cache)
route.HEAD("/stream", stream)
route.HEAD("/stream/*fname", stream)
route.GET("/stream", stream)
route.HEAD("/stream/*fname", stream)
route.GET("/stream/*fname", stream)
route.HEAD("/play/:hash/:id", play)
@@ -35,8 +37,9 @@ func SetupRoute(route gin.IRouter) {
authorized.POST("/viewed", viewed)
authorized.GET("/playlistall/all.m3u", allPlayList)
route.GET("/playlist", playList)
route.GET("/playlist/*fname", playList) // Is this endpoint still needed ? `fname` is never used in handler
route.GET("/playlist/*fname", playList)
authorized.GET("/download/:size", download)

View File

@@ -2,6 +2,7 @@ package api
import (
"net/http"
"strings"
"time"
sets "server/settings"
@@ -19,7 +20,8 @@ import (
// @Success 200
// @Router /shutdown [get]
func shutdown(c *gin.Context) {
if sets.ReadOnly {
reasonStr := strings.ReplaceAll(c.Param("reason"), `/`, "")
if sets.ReadOnly && reasonStr == "" {
c.Status(http.StatusForbidden)
return
}