justintv / Twitch-API

A home for details about our API
www.twitch.tv
1.72k stars 381 forks source link

Limit and offset parameters weird behavior #504

Closed tomtoump closed 8 years ago

tomtoump commented 8 years ago

limit=1&offset=0 returns 1 object as expected limit=1&offset=1 returns 2 objects

It's like the limit is set to the sum of limit and offset, and offset is always 0. This happens in any endpoint with paginated results.

FugiTech commented 8 years ago

This happens in any endpoint with paginated results.

As far as I can tell it only happens on the /kraken/channels/:channel/videos endpoint. If you have an example of it affecting other endpoints please let me know.

Meanwhile I'll investigate why it's happening on the videos endpoint. Thanks!

3ventic commented 8 years ago

I didn't notice it happening on any other endpoints when I checked it yesterday.

tomtoump commented 8 years ago

I was wrong. It doesn't happen on any endpoint, but only those related to videos. Apart from /channels/:channel/videos, /videos/top and /videos/followed are also affected.

fonsleenaars commented 8 years ago

Seems to be fixed now.

tomtoump commented 8 years ago

The pagination issue seems indeed fixed, but the _total is the number of videos returned from the current query instead of the expected total videos of the channel.

minigolf2000 commented 8 years ago

@tomtoump @Fugiman I just fixed the bug where _total points to the number of videos returned from the current query. It should be working now