This commit is contained in:
Simon Ding
2024-07-27 23:42:28 +08:00
parent e73ae86801
commit 02f6cfb5b7

View File

@@ -4,6 +4,7 @@ import (
"os"
"polaris/db"
"polaris/log"
"polaris/pkg/metadata"
"polaris/pkg/uptime"
"runtime"
@@ -51,3 +52,23 @@ func (s *Server) About(c *gin.Context) (interface{}, error) {
"version": db.Version,
}, nil
}
type parseIn struct {
S string `json:"s" binding:"required"`
}
func (s *Server) ParseTv(c *gin.Context) (interface{}, error) {
var in parseIn
if err := c.ShouldBindJSON(&in); err != nil {
return nil, errors.Wrap(err, "bind")
}
return metadata.ParseTv(in.S), nil
}
func (s *Server) ParseMovie(c *gin.Context) (interface{}, error) {
var in parseIn
if err := c.ShouldBindJSON(&in); err != nil {
return nil, errors.Wrap(err, "bind")
}
return metadata.ParseMovie(in.S), nil
}