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:
@@ -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"`
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user