mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
gofumpt -w .
This commit is contained in:
@@ -7,12 +7,13 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"server/settings"
|
"server/settings"
|
||||||
"server/torr"
|
"server/torr"
|
||||||
"server/version"
|
"server/version"
|
||||||
"server/web/auth"
|
"server/web/auth"
|
||||||
"strconv"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
@@ -76,6 +77,7 @@ func SetupRoute(r gin.IRouter) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func proxy(c *gin.Context, u string, h ...string) {
|
func proxy(c *gin.Context, u string, h ...string) {
|
||||||
if u == "" {
|
if u == "" {
|
||||||
c.AbortWithStatus(http.StatusBadRequest)
|
c.AbortWithStatus(http.StatusBadRequest)
|
||||||
@@ -95,6 +97,7 @@ func proxy(c *gin.Context, u string, h ...string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func serve(c *gin.Context) {
|
func serve(c *gin.Context) {
|
||||||
var j struct {
|
var j struct {
|
||||||
Data struct {
|
Data struct {
|
||||||
@@ -142,6 +145,7 @@ func serve(c *gin.Context) {
|
|||||||
c.JSON(200, map[string]any{"response": map[string]any{"status": http.StatusOK, "data": r}})
|
c.JSON(200, map[string]any{"response": map[string]any{"status": http.StatusOK, "data": r}})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func files(c *gin.Context, p string) {
|
func files(c *gin.Context, p string) {
|
||||||
if d, e := os.ReadDir(p); e == nil {
|
if d, e := os.ReadDir(p); e == nil {
|
||||||
var ds, fs []map[string]any
|
var ds, fs []map[string]any
|
||||||
|
|||||||
Reference in New Issue
Block a user