mirror of https://github.com/Xhofe/alist
fix(qbit): seed time doesn't take effect (close #5663)
parent
296be88b5f
commit
83c2269330
|
@ -54,7 +54,7 @@ func (a *QBittorrent) AddURL(args *tool.AddUrlArgs) (string, error) {
|
|||
}
|
||||
|
||||
func (a *QBittorrent) Remove(task *tool.DownloadTask) error {
|
||||
err := a.client.Delete(task.GID, true)
|
||||
err := a.client.Delete(task.GID, false)
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,9 @@ package tool
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/alist-org/alist/v3/internal/conf"
|
||||
"github.com/alist-org/alist/v3/internal/errs"
|
||||
"github.com/alist-org/alist/v3/internal/setting"
|
||||
"github.com/pkg/errors"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/xhofe/tache"
|
||||
|
@ -69,6 +71,18 @@ outer:
|
|||
return err
|
||||
}
|
||||
t.Status = "offline download completed, maybe transferring"
|
||||
// hack for qBittorrent
|
||||
if t.tool.Name() == "qBittorrent" {
|
||||
seedTime := setting.GetInt(conf.QbittorrentSeedtime, 0)
|
||||
if seedTime >= 0 {
|
||||
t.Status = "offline download completed, waiting for seeding"
|
||||
<-time.After(time.Minute * time.Duration(seedTime))
|
||||
err := t.tool.Remove(t)
|
||||
if err != nil {
|
||||
log.Errorln(err.Error())
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue