drime: fix listings of large directories

next_page is not currently being returned on listings which is causing
the rclone listing code to go wrong. This was returned so is likely a
regression in Drime.

This changes the page counter to calculate using current_page and
last_page. last_page on the first page request is just current_page+1.
drime appears to be capping per_page to 200. as more pages are
requested, last_page increments by 1 until current_page = last_page
This commit is contained in:
John Volk
2026-05-01 12:37:38 +01:00
committed by GitHub
parent 9c67942986
commit 306fb0a304
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -77,9 +77,9 @@ type Listing struct {
Data []Item `json:"data"`
From int `json:"from"`
LastPage int `json:"last_page"`
NextPage int `json:"next_page"`
NextPageURL string `json:"next_page_url"`
PerPage int `json:"per_page"`
PrevPage int `json:"prev_page"`
PrevPageURL string `json:"prev_page_url"`
To int `json:"to"`
Total int `json:"total"`
}
+2 -2
View File
@@ -565,10 +565,10 @@ OUTER:
break OUTER
}
}
if result.NextPage == 0 {
if result.CurrentPage == result.LastPage {
break
}
page = result.NextPage
page = result.CurrentPage + 1
}
return found, err
}