Proper caching
This commit is contained in:
@@ -88,7 +88,7 @@ func GetTorrents(accessToken string) ([]Torrent, error) {
|
||||
baseURL := "https://api.real-debrid.com/rest/1.0/torrents"
|
||||
var allTorrents []Torrent
|
||||
page := 1
|
||||
limit := 2500
|
||||
limit := 100
|
||||
|
||||
for {
|
||||
params := url.Values{}
|
||||
@@ -124,7 +124,7 @@ func GetTorrents(accessToken string) ([]Torrent, error) {
|
||||
|
||||
allTorrents = append(allTorrents, torrents...)
|
||||
|
||||
totalCountHeader := resp.Header.Get("x-total-count")
|
||||
totalCountHeader := "100" // resp.Header.Get("x-total-count")
|
||||
totalCount, err := strconv.Atoi(totalCountHeader)
|
||||
if err != nil {
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user