Feat: download torrent / multiple file / select file

This commit is contained in:
HFO4
2020-02-05 15:11:34 +08:00
parent 3ed84ad5ec
commit 491e4de9de
12 changed files with 197 additions and 55 deletions

View File

@@ -22,6 +22,8 @@ type Aria2 interface {
Status(task *model.Download) (rpc.StatusInfo, error)
// 取消任务
Cancel(task *model.Download) error
// 选择要下载的文件
Select(task *model.Download, files []int) error
}
const (
@@ -73,6 +75,11 @@ func (instance *DummyAria2) Cancel(task *model.Download) error {
return ErrNotEnabled
}
// Select 返回未开启错误
func (instance *DummyAria2) Select(task *model.Download, files []int) error {
return ErrNotEnabled
}
// Init 初始化
func Init() {
options := model.GetSettingByNames("aria2_rpcurl", "aria2_token", "aria2_options")