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

@@ -232,7 +232,7 @@ func (tb *Torbox) CheckStatus(torrent *torrent.Torrent, isSymlink bool) (*torren
}
}
break
} else if status == "downloading" {
} else if slices.Contains(tb.GetDownloadingStatus(), status) {
if !tb.DownloadUncached {
return torrent, fmt.Errorf("torrent: %s not cached", torrent.Name)
}
@@ -322,6 +322,10 @@ func (tb *Torbox) GetDownloadLink(t *torrent.Torrent, file *torrent.File) *torre
}
}
func (tb *Torbox) GetDownloadingStatus() []string {
return []string{"downloading"}
}
func (tb *Torbox) GetCheckCached() bool {
return tb.CheckCached
}