Proper caching

This commit is contained in:
Ben Sarmiento
2023-10-18 12:36:34 +02:00
parent bd72dc4540
commit acee02377e
9 changed files with 126 additions and 65 deletions

View File

@@ -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