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

Playlists tab only shows 50 items #1421

Closed
ThomasFrans opened this issue Mar 23, 2024 · 16 comments
Closed

Playlists tab only shows 50 items #1421

ThomasFrans opened this issue Mar 23, 2024 · 16 comments
Labels
bug Something isn't working

Comments

@ThomasFrans
Copy link
Contributor

ThomasFrans commented Mar 23, 2024

Describe the bug

ncspot only shows 50 playlists in the playlists tab. I counted them as I suspect it's a problem with paging which has a hard coded value that is 50 if I remember correctly. I think it had something to do with the Spotify API limiting requests to 50 items. I'm not 100% sure about this. When I scroll to the bottom of the list, more items aren't loaded, so it's not just a missing paging indicator.

To Reproduce

  1. Make sure you have 50 playlists in your library
  2. Open ncspot
  3. Go to tabs

Expected behavior

All playlists should load or a paging indicator should be shown.

Screenshots

image

System

Setup 1

  • OS: Arch Linux
  • Terminal: Alacritty v0.13.1 with Zellij v0.39.2
  • Version: ncspot 1.0.0 (38010b4)
  • Installed from: cargo

Setup 2

  • OS: Arch Linux
  • Terminal: Alacritty v0.13.1 with Zellij v0.39.2
  • Version: ncspot 1.1.0 (Arch Linux package is missing the git SHA-1 in ncspot --version)
  • Installed from: Arch package

Setup 3

  • OS: Arch Linux
  • Terminal: Alacritty v0.13.1 with Zellij v0.39.2
  • Version: v0.13.0 & v0.12.0
  • Installed from: from source

Setup 4

  • OS: Windows 11
  • Terminal: Windows Terminal
  • Version: ncspot 1.0.0 (I only remember the version but I'm not on Windows currently)
  • Installed from: winget

Backtrace/Debug log

/

Additional context

I opened ncspot on Linux where it had already run before and saw way more playlists before it updated the library and most of them disappeared and only 50 were left. I moved some playlists into folders on Spotify recently, so I thought that might have been it. I tried moving them all out of the folders again, waited a few hours so any caching on their end would probably be gone and tried again without luck. The bug still occurs.

@ThomasFrans ThomasFrans added the bug Something isn't working label Mar 23, 2024
@ThomasFrans
Copy link
Contributor Author

Slightly worrying: I think it might not be ncspot but Spotify that's causing this. The reason is that when I open ncspot, I can't go to the Spotify website anymore and instead get a "429: Too many requests" error. It probably sees me loading my library as excessive use of the API as ncspot loads everything at once. I've been seeing this error for a while now but didn't make the connection until now. ncspot starts in the background so that's probably why I got that error sometimes without even having opened Spotify itself that day.

A solution would be lazy loading of container items, but that wouldn't be easy to implement...

@Bettehem
Copy link
Contributor

Hello, I have noticed the 429 error too when developing my music bot which in case of Spotify fetches track metadata etc from their API. When Spotify returns a 429 error code, it also returns a "Retry-After" header field, which contains a value in milliseconds for how long you should wait before the next request.
So for me the solution was to just wait for the given time and then do the next request

@ThomasFrans
Copy link
Contributor Author

Oh I didn't know. For me the 429 error on their website lasts for several minutes though so I don't know whether that's a solution. I also think ncspot already has handling for 429 in spotify_api.rs, so something must have changed on Spotify's end or the 429 logic in ncspot was never used before.

@Bettehem
Copy link
Contributor

If I recall, the "Retry-After" keeps increasing if it is not respected, so that could be why your 429 error lasts for minutes

@ThomasFrans
Copy link
Contributor Author

That might be the reason for the long waiting time then. Still, something must have changed as for example v0.13.0 used to work fine and now it doesn't. I don't know what changed, but I do know that I have way more than 50 playlists and only 50 of them are showing currently. I will try to look into this further when I have the time, but that will sadly not be soon 😢

@ethanredmond2
Copy link

It's good that it's not just me having this problem, I was quite worried when I opened ncspot this morning!

I can confirm this happens for me too, although I'm on v0.13.0 and it's still broken, so I suspect it's a change on Spotify's end with their API.

I have around 200 playlists that used to all show in ncspot using the "Custom order" I ordered them all in Spotify by dragging and dropping. Now ncspot only shows the first 50 most recent playlists, according to the order I last listened to each one in Spotify, with the most recent at the top and least recent at the bottom.

I haven't changed anything with Spotify like putting playlists into folders, and I have all my playlists in many different nested folders anyway.

I don't know how to check if I get a 429 error from Spotify but if you show me how I'll see if I can confirm that happens for me too :)

@orange-toothbrush
Copy link

Having a similar issue after update, except no playlists are showing up at all. Tracks, Albums, and Artists works, but not Podcasts or Playlists. Hope this helps.

@ThomasFrans
Copy link
Contributor Author

I don't know how to check if I get a 429 error from Spotify but if you show me how I'll see if I can confirm that happens for me too :)

@ethanredmond2 It shows up when I browse to the web player. I get a plain white page with 439 instead.

@ethanredmond2
Copy link

Interesting, my Spotify web player works fine and has no errors (open.spotify.com), although it very briefly shows this error before loading (it's probably unrelated):

image

@hrkfdn
Copy link
Owner

hrkfdn commented Apr 1, 2024

Possibly related: librespot-org/librespot#1261

@hrkfdn
Copy link
Owner

hrkfdn commented Apr 1, 2024

One way to verify this could be by checking if the problem is fixed with this branch: #1244

@ThomasFrans
Copy link
Contributor Author

That fixes it. I guess I'll just use that branch for now.

@hrkfdn
Copy link
Owner

hrkfdn commented Apr 21, 2024

Are you still experiencing this with the release? I can't reproduce it with the main branch..

@ThomasFrans
Copy link
Contributor Author

I think the combination of VPN + downloading the entire library was causing rate limits. I noticed that every time I opened ncspot, the web player would become broken as well. I kind of stopped using ncspot because of this, which is sad as I like it way more than the web player, but the rate limits just make it impossible. I also received very frequent emails that forced me to reset my password, which was probably caused by the same problem.

This issue is probably only a problem with a VPN, so nothing that can easily be solved in ncspot. I will close this.

@ThomasFrans ThomasFrans closed this as not planned Won't fix, can't repro, duplicate, stale Apr 21, 2024
@ethanredmond2
Copy link

It's not limited to 50 playlists for me anymore, it shows all my playlists. It's possible Spotify fixed the problem on their end? Interestingly though, my playlists are now in order of most recently played instead of the custom order I manually dragged and dropped them in the Spotify interface.
Using the branch also didn't fix the 50 playlists limit for me, although it's possible I did it wrong.

@ThomasFrans
Copy link
Contributor Author

I don't know whether it was the branch that solved it or it just happened to work that time. I'll probably come back to ncspot at some point. I might just remove my VPN as it causes more problems than it's solving (ncspot > online "privacy")

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

5 participants