Closed harleypig closed 2 years ago
Thanks for reporting, we'll look into it.
Do you have the same nickname on last.fm as here? Maybe it's because of a large number of favorites and the API can't handle it?
https://www.last.fm/api/show/user.getLovedTracks
According to the docs the "limit" param controls how many tracks we download. As it doesn't indicate the maximum limit, we try to download all the tracks at once. Apparently 2664 is too many.
Looks like the max is 1000
Hi, I would be interested in working on this as my first issue if still available! :)
Sure, I just identified the problem yesterday. Let me give you some more info for context:
This is where we download the favorites. Currently, this function returns a promise with the response, but now we need to check if the limit is greater than 1000, and paginate our requests as necessary to download the entire collection of favorite tracks.
Please remember to cover this functionality with tests as well.
Ok looks like this limit was actually mentioned, and it's partially implemented in the related action: https://github.com/nukeop/nuclear/blob/d0b384789bd1eb3b8d5a136a4aa1dd46c4db3e97/packages/app/app/actions/importfavs.js#L49
It partially implements pagination for n>1000.
@nukeop I have finished implementing this feature, I am just finishing up the tests now. What do you think would be the best way to test this feature?
Since this API call requires a userId, should I just use my own Last.fm account for the tests? For ex, I have 1000+ songs liked on my account so I could just test making multiple calls (with different pages passed in) to this endpoint and verify the responses are valid. I could add this to lastfm.test.ts
. Would this be sufficient?
Let me know if you have any suggestions, thanks!
Is it possible to fix this soon? When I see this right, it just needs to be tested.
Just what the title says ... I logged in to last.fm with no apparent issues. Nuclear appears to be scrobbling correctly.
Clicking the Import button for Last.fm Favorites gives: "Error: Invalid number of favorites [2664]"