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

How to page through a playlist response? #6

Open
s2t2 opened this issue Mar 5, 2015 · 0 comments
Open

How to page through a playlist response? #6

s2t2 opened this issue Mar 5, 2015 · 0 comments

Comments

@s2t2
Copy link

s2t2 commented Mar 5, 2015

Hey, sorry if this is documented somewhere, but what is the intended methodology for paging through tracks in a playlist?

The following approaches don't seem to work...

Hypem.user(USER_NAME).loved_playlist.page(1).tracks.first.title
=> "first page first track title"

Hypem.user(USER_NAME).loved_playlist.page(2).tracks.first.title
=> "first page first track title" # expecting "second page first track title"
user = Hypem.user(USER_NAME)
playlist = user.loved_playlist
page = playlist.page(1)
tracks = page.tracks
tracks.each do |track|
  # do some stuff
end
page = page.next_page 
=> nil
user = Hypem.user(USER_NAME)
playlist = user.loved_playlist
page = playlist.page(1)
tracks = page.tracks
tracks.each do |track|
  # do some stuff
end
p2 = playlist.next_page
p2.tracks.first.title
=> "first page first track title" # expecting "second page first track title"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant