Use 500 as limit to prevent timeouts

This commit is contained in:
Ben Sarmiento
2024-02-11 11:43:19 +01:00
parent 1769fc6d34
commit 2da715f694

View File

@@ -109,14 +109,14 @@ func (rd *RealDebrid) UnrestrictLink(link string, checkFirstByte bool) (*Downloa
}
// GetTorrents returns all torrents, paginated
// if customLimit is 0, the default limit of 1000 is used
// if customLimit is 0, the default limit of 500 is used
func (rd *RealDebrid) GetTorrents(customLimit int, active bool) ([]Torrent, int, error) {
baseURL := "https://api.real-debrid.com/rest/1.0/torrents"
var allTorrents []Torrent
page := 1
limit := customLimit
if limit == 0 {
limit = 1000
limit = 500
}
totalCount := 0
@@ -322,7 +322,7 @@ func (rd *RealDebrid) GetActiveTorrentCount() (*ActiveTorrentCountResponse, erro
func (rd *RealDebrid) GetDownloads(page, offset int) ([]Download, int, error) {
baseURL := "https://api.real-debrid.com/rest/1.0/downloads"
var allDownloads []Download
limit := 1000
limit := 500
totalCount := 0
params := url.Values{}