Fix detection issues

This commit is contained in:
Ben Sarmiento
2024-02-18 04:15:41 +01:00
parent 02d900971d
commit 36298dd979
6 changed files with 63 additions and 67 deletions

View File

@@ -8,6 +8,7 @@ import (
"strconv"
"strings"
"github.com/debridmediamanager/zurg/internal/config"
zurghttp "github.com/debridmediamanager/zurg/pkg/http"
"github.com/debridmediamanager/zurg/pkg/logutil"
)
@@ -16,14 +17,16 @@ type RealDebrid struct {
client *zurghttp.HTTPClient
unrestrictClient *zurghttp.HTTPClient
downloadClient *zurghttp.HTTPClient
cfg config.ConfigInterface
log *logutil.Logger
}
func NewRealDebrid(client, unrestrictClient, downloadClient *zurghttp.HTTPClient, log *logutil.Logger) *RealDebrid {
func NewRealDebrid(client, unrestrictClient, downloadClient *zurghttp.HTTPClient, cfg config.ConfigInterface, log *logutil.Logger) *RealDebrid {
return &RealDebrid{
client: client,
unrestrictClient: unrestrictClient,
downloadClient: downloadClient,
cfg: cfg,
log: log,
}
}
@@ -119,7 +122,7 @@ func (rd *RealDebrid) GetTorrents(customLimit int, active bool) ([]Torrent, int,
page := 1
limit := customLimit
if limit == 0 {
limit = 100
limit = rd.cfg.GetTorrentsCount()
}
totalCount := 0