Use the chunk manager properly

This commit is contained in:
Ben Sarmiento
2023-11-18 01:51:25 +01:00
parent 4da9416bec
commit b669f8d673
10 changed files with 30 additions and 31 deletions

View File

@@ -6,8 +6,8 @@ import (
"hash/fnv"
"os"
"github.com/debridmediamanager.com/zurg/internal/config"
"github.com/debridmediamanager.com/zurg/internal/torrent"
zurghttp "github.com/debridmediamanager.com/zurg/pkg/http"
)
// Manager manages chunks on disk
@@ -59,7 +59,7 @@ func NewManager(
loadThreads,
maxChunks int,
torMgr *torrent.TorrentManager,
cfg config.ConfigInterface) (*Manager, error) {
client *zurghttp.HTTPClient) (*Manager, error) {
pageSize := int64(os.Getpagesize())
if chunkSize < pageSize {
@@ -82,7 +82,7 @@ func NewManager(
return nil, err
}
downloader, err := NewDownloader(loadThreads, storage, chunkSize, torMgr)
downloader, err := NewDownloader(loadThreads, storage, chunkSize, torMgr, client)
if nil != err {
return nil, err
}