try to fix memory hogging

This commit is contained in:
Mukhtar Akere
2025-02-28 16:05:04 +01:00
parent fce2ce28c7
commit 84bd93805f
6 changed files with 33 additions and 8 deletions

View File

@@ -11,6 +11,7 @@ import (
"github.com/sirrobot01/debrid-blackhole/internal/request"
"github.com/sirrobot01/debrid-blackhole/internal/utils"
"github.com/sirrobot01/debrid-blackhole/pkg/debrid/torrent"
"slices"
"net/http"
"os"
@@ -216,7 +217,7 @@ func (dl *DebridLink) CheckStatus(torrent *torrent.Torrent, isSymlink bool) (*to
return torrent, err
}
break
} else if status == "downloading" {
} else if slices.Contains(dl.GetDownloadingStatus(), status) {
if !dl.DownloadUncached {
return torrent, fmt.Errorf("torrent: %s not cached", torrent.Name)
}
@@ -263,6 +264,10 @@ func (dl *DebridLink) GetDownloadLink(t *torrent.Torrent, file *torrent.File) *t
return &dlLink
}
func (dl *DebridLink) GetDownloadingStatus() []string {
return []string{"downloading"}
}
func (dl *DebridLink) GetCheckCached() bool {
return dl.CheckCached
}