mirror of
https://github.com/Monibuca/plugin-hdl.git
synced 2025-09-27 13:12:16 +08:00
fix: pull api return json format
This commit is contained in:
4
main.go
4
main.go
@@ -52,9 +52,9 @@ func str2number(s string) int {
|
|||||||
func (c *HDLConfig) API_Pull(rw http.ResponseWriter, r *http.Request) {
|
func (c *HDLConfig) API_Pull(rw http.ResponseWriter, r *http.Request) {
|
||||||
err := HDLPlugin.Pull(r.URL.Query().Get("streamPath"), r.URL.Query().Get("target"), NewHDLPuller(), str2number(r.URL.Query().Get("save")))
|
err := HDLPlugin.Pull(r.URL.Query().Get("streamPath"), r.URL.Query().Get("target"), NewHDLPuller(), str2number(r.URL.Query().Get("save")))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(rw, err.Error(), http.StatusBadRequest)
|
util.ReturnError(util.APIErrorPublish, err.Error(), rw, r)
|
||||||
} else {
|
} else {
|
||||||
rw.Write([]byte("ok"))
|
util.ReturnOK(rw, r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user