You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tried using limit/offset to implement pagination in a script, and discovered the results wrap around. I expected that the result would be empty when I set the offset past the total number of results, but instead the results wrap around.
Steps to reproduce
Create category with 10 torrents
GET /api/v2/torrents/info?limit=10&category=Example&offset=0 - 10 results as expected
GET /api/v2/torrents/info?limit=10&category=Example&offset=10 - 10 results repeated, expected no results
GET /api/v2/torrents/info?limit=10&category=Example&offset=20 - 10 results repeated, expected no results
An even easier way to replicate is using limit=1 and incrementing the offset by 1. This will produce results forever. It seems the only way to detect reaching the end is to keep track of previously seen results.
Additional context
No response
Log(s) & preferences file(s)
not relevant
The text was updated successfully, but these errors were encountered:
qBittorrent & operating system versions
qBittorrent: v5.0.3 amd64
Package: qbittorent-nox
Operating system: Ubuntu 24.10
What is the problem?
Tried using limit/offset to implement pagination in a script, and discovered the results wrap around. I expected that the result would be empty when I set the offset past the total number of results, but instead the results wrap around.
Steps to reproduce
An even easier way to replicate is using limit=1 and incrementing the offset by 1. This will produce results forever. It seems the only way to detect reaching the end is to keep track of previously seen results.
Additional context
No response
Log(s) & preferences file(s)
not relevant
The text was updated successfully, but these errors were encountered: