mirror of
https://github.com/simon-ding/polaris.git
synced 2026-04-22 19:57:56 +08:00
fix
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"polaris/db"
|
"polaris/db"
|
||||||
"polaris/log"
|
"polaris/log"
|
||||||
|
"polaris/pkg/metadata"
|
||||||
"polaris/pkg/uptime"
|
"polaris/pkg/uptime"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
@@ -51,3 +52,23 @@ func (s *Server) About(c *gin.Context) (interface{}, error) {
|
|||||||
"version": db.Version,
|
"version": db.Version,
|
||||||
}, nil
|
}, 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