wip: adapt qBittorrent

This commit is contained in:
Andy Hsu
2023-10-06 16:02:29 +08:00
parent 12dfb60a66
commit 1490da8b53
5 changed files with 455 additions and 8 deletions

View File

@ -1,12 +1,10 @@
package handles
import (
"github.com/alist-org/alist/v3/internal/aria2"
"github.com/alist-org/alist/v3/internal/conf"
"github.com/alist-org/alist/v3/internal/model"
"github.com/alist-org/alist/v3/internal/offline_download/tool"
"github.com/alist-org/alist/v3/internal/op"
"github.com/alist-org/alist/v3/internal/qbittorrent"
"github.com/alist-org/alist/v3/server/common"
"github.com/gin-gonic/gin"
)
@ -30,7 +28,8 @@ func SetAria2(c *gin.Context) {
common.ErrorResp(c, err, 500)
return
}
version, err := aria2.InitClient(2)
_tool, err := tool.Tools.Get("aria2")
version, err := _tool.Init()
if err != nil {
common.ErrorResp(c, err, 500)
return
@ -57,7 +56,12 @@ func SetQbittorrent(c *gin.Context) {
common.ErrorResp(c, err, 500)
return
}
if err := qbittorrent.InitClient(); err != nil {
_tool, err := tool.Tools.Get("qBittorrent")
if err != nil {
common.ErrorResp(c, err, 500)
return
}
if _, err := _tool.Init(); err != nil {
common.ErrorResp(c, err, 500)
return
}