@ -54,9 +54,7 @@ func (t *DownloadTask) Run() error {
|
||||
return err
|
||||
}
|
||||
t.GID = gid
|
||||
var (
|
||||
ok bool
|
||||
)
|
||||
var ok bool
|
||||
outer:
|
||||
for {
|
||||
select {
|
||||
@ -81,6 +79,15 @@ outer:
|
||||
if t.tool.Name() == "pikpak" {
|
||||
return nil
|
||||
}
|
||||
if t.tool.Name() == "115 Cloud" {
|
||||
// hack for 115
|
||||
<-time.After(time.Second * 1)
|
||||
err := t.tool.Remove(t)
|
||||
if err != nil {
|
||||
log.Errorln(err.Error())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
t.Status = "offline download completed, maybe transferring"
|
||||
// hack for qBittorrent
|
||||
if t.tool.Name() == "qBittorrent" {
|
||||
@ -136,6 +143,9 @@ func (t *DownloadTask) Complete() error {
|
||||
if t.tool.Name() == "pikpak" {
|
||||
return nil
|
||||
}
|
||||
if t.tool.Name() == "115 Cloud" {
|
||||
return nil
|
||||
}
|
||||
if getFileser, ok := t.tool.(GetFileser); ok {
|
||||
files = getFileser.GetFiles(t)
|
||||
} else {
|
||||
@ -166,6 +176,4 @@ func (t *DownloadTask) GetStatus() string {
|
||||
return t.Status
|
||||
}
|
||||
|
||||
var (
|
||||
DownloadTaskManager *tache.Manager[*DownloadTask]
|
||||
)
|
||||
var DownloadTaskManager *tache.Manager[*DownloadTask]
|
||||
|
Reference in New Issue
Block a user