mirror of
https://github.com/simon-ding/polaris.git
synced 2026-02-06 23:21:00 +08:00
fix
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user