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

Only 98 songs out of my over 340 songs show up in my library with the 'Songs' layout. #12

Closed
kane090 opened this issue Jun 21, 2018 · 9 comments
Labels
bug Something isn't working

Comments

@kane090
Copy link

kane090 commented Jun 21, 2018

As the title says.

@kane090 kane090 changed the title Only 98-100 songs out of my over 340 songs show up in my library in the song layout. Only 98 songs out of my over 340 songs show up in my library with the 'Songs' layout. Jun 21, 2018
@zachomedia zachomedia added the bug Something isn't working label Jun 21, 2018
@zachomedia
Copy link
Owner

@kane090 The songs page loads in 100 song increments. Can you check the console for any errors?

@kane090
Copy link
Author

kane090 commented Jun 21, 2018

I am using Chrome on Windows 10 and this is what I got from the console.

The SSL certificate used to load resources from will be distrusted in M. Once distrusted, users will be prevented from loading these resources. See for more information.
music.zacharyseguin.ca/:1 The SSL certificate used to load resources from https://is4-ssl.mzstatic.com will be distrusted in M70. Once distrusted, users will be prevented from loading these resources. See https://g.co/chrome/symantecpkicerts for more information.
music.zacharyseguin.ca/:1 The SSL certificate used to load resources from https://is2-ssl.mzstatic.com will be distrusted in M70. Once distrusted, users will be prevented from loading these resources. See https://g.co/chrome/symantecpkicerts for more information.
music.zacharyseguin.ca/:1 The SSL certificate used to load resources from https://is5-ssl.mzstatic.com will be distrusted in M70. Once distrusted, users will be prevented from loading these resources. See https://g.co/chrome/symantecpkicerts for more information.
music.zacharyseguin.ca/:1 The SSL certificate used to load resources from https://is3-ssl.mzstatic.com will be distrusted in M70. Once distrusted, users will be prevented from loading these resources. See https://g.co/chrome/symantecpkicerts for more information.
music.zacharyseguin.ca/:1 The SSL certificate used to load resources from https://is1-ssl.mzstatic.com will be distrusted in M70. Once distrusted, users will be prevented from loading these resources. See https://g.co/chrome/symantecpkicerts for more information.

@zachomedia
Copy link
Owner

Can you run the two following commands in the console?:

MusicKit.getInstance().api.library.songs(null, { limit: 100 }).then(r => console.log(r.length));
MusicKit.getInstance().api.library.songs(null, { offset: 100, limit: 100 }).then(r => console.log(r.length));

@kane090
Copy link
Author

kane090 commented Jun 23, 2018

I ran the commands and this is what I got:

MusicKit.getInstance().api.library.songs(null, { limit: 100 }).then(r => console.log(r.length));
Promise {}
VM81:1 98
MusicKit.getInstance().api.library.songs(null, { offset: 100, limit: 100 }).then(r => console.log(r.length));
Promise {}
VM97:1 99

@zachomedia
Copy link
Owner

Can you look at the request to https://api.music.apple.com/v1/me/library/songs in the Network tab, and see if there is a next value in the response/what the value is?

@kane090
Copy link
Author

kane090 commented Jun 23, 2018

{next: "/v1/me/library/songs?offset=100",…}
data
:
[{id: "i.2P0NDPNtxONpg1", type: "library-songs", href: "/v1/me/library/songs/i.2P0NDPNtxONpg1",…},…]
next
:
"/v1/me/library/songs?offset=100"

@zachomedia
Copy link
Owner

Interesting. Unfortunately, the next param doesn't get passed through in the response to my application. I just changed the logic to keep up on increasing the offset until the response contains 0 items. Can you try the songs view now?

@kane090
Copy link
Author

kane090 commented Jun 23, 2018

Just tried the view. Every song shows up! Well done and thank you!

@zachomedia
Copy link
Owner

Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants