fix: init aria2 client
This commit is contained in:
parent
58d153e5ff
commit
786e44d1d2
@ -26,11 +26,11 @@ func InitAria2Client(uri string, secret string, timeout int) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "failed to init aria2 client")
|
return errors.Wrap(err, "failed to init aria2 client")
|
||||||
}
|
}
|
||||||
client = c
|
version, err := c.GetVersion()
|
||||||
version, err := client.GetVersion()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrapf(err, "failed get aria2 version")
|
return errors.Wrapf(err, "failed get aria2 version")
|
||||||
}
|
}
|
||||||
|
client = c
|
||||||
log.Infof("using aria2 version: %s", version.Version)
|
log.Infof("using aria2 version: %s", version.Version)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -11,8 +11,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type SetAria2Req struct {
|
type SetAria2Req struct {
|
||||||
Uri string `json:"uri"`
|
Uri string `json:"uri" form:"uri"`
|
||||||
Secret string `json:"secret"`
|
Secret string `json:"secret" form:"secret"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetAria2(c *gin.Context) {
|
func SetAria2(c *gin.Context) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user