diff --git a/internal/app.go b/internal/app.go index f271afa..6c994ec 100644 --- a/internal/app.go +++ b/internal/app.go @@ -52,9 +52,9 @@ func MainApp(configPath string) { apiClient := http.NewHTTPClient( config.GetToken(), - config.GetRetriesUntilFailed()*2, // default retries = 2, so this is 4 - config.GetApiTimeoutSecs(), // default api timeout = 60 - false, // ipv6 support is not needed for api client + config.GetRetriesUntilFailed(), // default retries = 2, so this is 4 + config.GetApiTimeoutSecs(), // default api timeout = 60 + false, // ipv6 support is not needed for api client config, log.Named("api_client"), ) diff --git a/internal/torrent/repair.go b/internal/torrent/repair.go index 128577c..1552082 100644 --- a/internal/torrent/repair.go +++ b/internal/torrent/repair.go @@ -503,7 +503,7 @@ func (t *TorrentManager) canCapacityHandle() bool { } func (t *TorrentManager) markAsUnplayable(torrent *Torrent, reason string) { - t.repairLog.Warnf("Torrent %s is unplayable (reason: %s), moving to unplayable directory", t.GetKey(torrent), reason) + t.repairLog.Debugf("Torrent %s is unplayable (reason: %s), moving to unplayable directory", t.GetKey(torrent), reason) // reassign to unplayable torrents directory t.DirectoryMap.IterCb(func(directory string, torrents cmap.ConcurrentMap[string, *Torrent]) { if strings.HasPrefix(directory, "int__") { diff --git a/pkg/http/client.go b/pkg/http/client.go index f2f99b5..aa6d852 100644 --- a/pkg/http/client.go +++ b/pkg/http/client.go @@ -60,7 +60,7 @@ func NewHTTPClient( ) *HTTPClient { client := HTTPClient{ bearerToken: token, - client: http.DefaultClient, + client: &http.Client{}, maxRetries: maxRetries, timeoutSecs: timeoutSecs, backoff: backoffFunc, diff --git a/pkg/realdebrid/api.go b/pkg/realdebrid/api.go index d5cfad8..a8e7505 100644 --- a/pkg/realdebrid/api.go +++ b/pkg/realdebrid/api.go @@ -175,7 +175,7 @@ func (rd *RealDebrid) GetTorrents(onlyOne bool) ([]Torrent, int, error) { // compute ceiling of totalCount / limit maxPages := (totalCount + rd.cfg.GetTorrentsCount() - 1) / rd.cfg.GetTorrentsCount() rd.log.Debugf("Torrents total count is %d, max pages is %d", totalCount, maxPages) - maxParallelThreads := 2 + maxParallelThreads := 4 if maxPages < maxParallelThreads { maxParallelThreads = maxPages } @@ -194,7 +194,7 @@ func (rd *RealDebrid) GetTorrents(onlyOne bool) ([]Torrent, int, error) { for i := 0; i < maxParallelThreads; i++ { res := <-allResults if res.err != nil { - return nil, 0, res.err + continue } allTorrents = append(allTorrents, res.torrents...) }