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

[Bug]: nextCursor is null #981

Open
alpertunga-bile opened this issue Jan 28, 2024 · 1 comment
Open

[Bug]: nextCursor is null #981

alpertunga-bile opened this issue Jan 28, 2024 · 1 comment
Labels
bug-report Something might not be working

Comments

@alpertunga-bile
Copy link

What happened?

  • api/v1/images?limit=200&sort=Newest&period=AllTime&cursor=0 works fine and has a valid value for nextCursor in metadata. But for api/v1/images?limit=200&sort=Most%20Reactions&period=AllTime&cursor=0 the nextCursor variable is null.
  • It works fine when the sort value is Newest, but for other values the nextCursor variable is null

Steps to reproduce the problem

  1. Select a sort value other than Newest
  2. Modify this text with selected sort value https://civitai.com/api/v1/images?limit=200&sort=<your sort value>&period=AllTime&cursor=0
  3. Paste this link to browser's address bar and check the metadata->nextCursor

What should have happened?

The nextCursor variable had to have valid integer cursor value.

What platforms do you use to access the site?

Windows

What browsers do you use to access the site?

Mozilla Firefox

Additional information, context and logs

  • I tried to move cursor as the total items count but I am not sure if the new cursor is going to bring me the next results or take me to the wrong list
  • I tried with page variable rather than cursor variable but the page variable is finished at 1 and nextCursor variable is null
@alpertunga-bile alpertunga-bile added the bug-report Something might not be working label Jan 28, 2024
@SinaYa
Copy link

SinaYa commented Feb 2, 2024

@alpertunga-bile

You can use nextPage instead which still works when using 'cursor'.

I faced a similar problem (which still persists) which was that I couldn't get nextPage nor nextCursor and since I couldn't find a solution to it I had to change the behaviour of my app to load images newest to latest since the only API routes that gave me a 'nextPage' were the ones that use 'cursor' and also sort by 'Newest'.

example of working route:
https://civitai.com/api/v1/images?cursor=0&limit=200&sort=Newest&modelVersionId=268123

Well actually, this also doesn't work right now since as of writing (Friday, February 2nd, 2024) a new problem occurred that gives a status 500 error if there are any query parameters given at all but I hope it's just server maintenance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Something might not be working
Projects
None yet
Development

No branches or pull requests

2 participants