diff --git a/internal/offline_download/qbit/qbit.go b/internal/offline_download/qbit/qbit.go index c2e92d2dce0..807ebfef2dc 100644 --- a/internal/offline_download/qbit/qbit.go +++ b/internal/offline_download/qbit/qbit.go @@ -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 } diff --git a/internal/offline_download/tool/download.go b/internal/offline_download/tool/download.go index 0e1a9ca8335..975530e7f6a 100644 --- a/internal/offline_download/tool/download.go +++ b/internal/offline_download/tool/download.go @@ -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 }