How do you do pagination?
Closed this issue · 3 comments
My apologies if this I've missed something - but it's not clear from the docs (https://epistrephein.github.io/rarbg/) how you pagination through results?
For example, if search() return 25 results, how do you get to page 2, page 3 etc?
@victorhooi Unfortunately pagination is not supported by the API backend and the gem can only interface to what's available there.
Your options are to either return more results (e.g. limit: 100
), better filter the query (e.g. with category
or min_seeders
params) or change the sorting (e.g. sort: :seeders
).
Right - but the limit has a max value of 100, correct?
Hmm - how about if you sort by publication date of the torrent, then use min_date, and keep incrementing that?
Is it possible to sort by date, and also filter by date?
Yes limit
is capped at 100.
You can sort by :last
which is publication date, but you can't filter by date, so you would only retrieve the 100 most recent results.
I believe this upstream design choice was made specifically to avoid abuses where someone just paginates through all results and builds a database of all records, so I don't think we're gonna see any of this available soon.