-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Fix: Search not showing next page button when a next page exists #4126
Fix: Search not showing next page button when a next page exists #4126
Conversation
34c6750
to
3c6742b
Compare
3c6742b
to
b305836
Compare
if new_node = node["itemSectionRenderer"]? | ||
raw_items << new_node["contents"].as_a | ||
end | ||
if node["continuationItemRenderer"]? | ||
raw_items.push([node]) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if new_node = node["itemSectionRenderer"]? | |
raw_items << new_node["contents"].as_a | |
end | |
if node["continuationItemRenderer"]? | |
raw_items.push([node]) | |
end | |
if new_node = node["itemSectionRenderer"]? | |
raw_items << new_node["contents"].as_a | |
elsif node["continuationItemRenderer"]? | |
raw_items.push([node]) | |
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Iirc they're both in the same object which is why i didnt do an elsif. I can probably double check in a few days (not at my computer right now)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering, what's the use case for that?
If I understand correctly, it will extract the continuation for shelf renderers and alike?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, for the search page, the continuation seems to be in the same json object as the itemSectionRenderer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@syeopite improving upon your suggestion with the use of <<
@ChunkyProgrammer after that I think we're all good ^^
if new_node = node["itemSectionRenderer"]? | |
raw_items << new_node["contents"].as_a | |
end | |
if node["continuationItemRenderer"]? | |
raw_items.push([node]) | |
end | |
if new_node = node["itemSectionRenderer"]? | |
raw_items << new_node["contents"].as_a | |
elsif node["continuationItemRenderer"]? | |
raw_items << node | |
end |
b305836
to
efbbec3
Compare
3433a14
to
1409705
Compare
Co-Authored-By: syeopite <70992037+syeopite@users.noreply.github.com> Co-Authored-By: Samantaz Fox <coding@samantaz.fr>
1409705
to
4119cec
Compare
There seems to still be continuation tokens but no next page... (the button displays but clicking the button leads to a blank page) |
There's some issues with this PR so I'll be closing it for the time being, I might open another PR in a few weeks that should hopefully work better |
closes #1708
Similar to (part of): #3864
This PR checks for a continuation token to determine whether a next page button should be shown. A good example to test this with is when adding videos to a playlist.
Test case:
Whether there's a next page or not is not included in the api as it would have to be a breaking change