Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offset and Limit options have erroneous hard limits #100

Closed
ksewo opened this issue Nov 16, 2020 · 2 comments
Closed

Offset and Limit options have erroneous hard limits #100

ksewo opened this issue Nov 16, 2020 · 2 comments
Assignees
Labels

Comments

@ksewo
Copy link

ksewo commented Nov 16, 2020

SetLimit and SetOffset returns error if number higher than 5000 is provided.

There is no limit for offset for IGDB v4 API.
image

Limit also changed to 500 (not 5000 as in the code).
image

According to:
https://api-docs.igdb.com/#pagination

@Henry-Sarabia
Copy link
Owner

Oh my, that's no good -- nice catch! I'll have this fixed up in the next patch. Thanks for contributing!

@Henry-Sarabia Henry-Sarabia changed the title Offset is limited to 5000 by code, but can be higher Offset and Limit options have erroneous hard limits Nov 20, 2020
@Henry-Sarabia Henry-Sarabia added this to the v2.0.0-alpha.4 milestone Nov 20, 2020
@Henry-Sarabia Henry-Sarabia self-assigned this Nov 20, 2020
@ksewo
Copy link
Author

ksewo commented Nov 20, 2020

@Henry-Sarabia Thanks for looking into that.

For those who can't wait until next patch, here is temporary fix:
Create your own versions of SetOffset and SetLimit.
Example:

import (
	"github.com/Henry-Sarabia/apicalypse"
	"github.com/Henry-Sarabia/igdb/v2"
)

func SetOffset(offset int) igdb.Option {
	return func() (apicalypse.Option, error) {
		return apicalypse.Offset(offset), nil
	}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants