aome510 / spotify-player

A Spotify player in the terminal with full feature parity
MIT License
3.14k stars 137 forks source link

error loading playlists without images #401

Closed mochimisu closed 3 months ago

mochimisu commented 4 months ago

Describe the bug images can be null in some playlists. seems to be true for some old playlists, but also empty playlists

To Reproduce

  1. Create an empty playlist.
  2. Remove Playlist_cache.json
  3. Start spotify_player
  4. Note empty playlists window

Expected behaviour Playlists should load

Log and backtrace Relevant log line

2024-03-25T01:17:07.902710Z ERROR client_request{request=GetUserPlaylists}: spotify_player::client::handlers: Failed to handle client request: json parse error: invalid type: null, expected a sequence at line 1 column 392: invalid type: null, expected a sequence at line 1 column 392

Screenshots If applicable, add screenshots to help explain your problem. 20240324_18h21m59s_grim

Environment

Additional context example problematic json {"href":"https://api.spotify.com/v1/users/.../playlists?offset=0&limit=1","limit":1,"next":"https://api.spotify.com/v1/users/.../playlists?offset=1&limit=1","offset":0,"previous":null,"total":43,"items":[{"collaborative":false,"description":"","external_urls":{"spotify":"https://open.spotify.com/playlist/..."},"href":"https://api.spotify.com/v1/playlists/...","id":"...","images":null,"name":"My Playlist #26","owner":{"display_name":"...","external_urls":{"spotify":"https://open.spotify.com/user/..."},"href":"https://api.spotify.com/v1/users/...","id":"...","type":"user","uri":"spotify:user:..."},"primary_color":null,"public":true,"snapshot_id":"...","tracks":{"href":"https://api.spotify.com/v1/playlists/.../tracks","total":0},"type":"playlist","uri":"spotify:playlist:..."}]}

aome510 commented 4 months ago

I'm well aware of this issue: https://github.com/ramsayleung/rspotify/issues/459, it seems rspotify doesn't want to fix it. I implemented a patch but only for get-playlist API. Will create another patch for get-playlists.

aome510 commented 4 months ago

@mochimisu can you try running in https://github.com/aome510/spotify-player/pull/402 to see if it fixes the issue?

Icelk commented 3 months ago

Before the next release, one may use the API to check which playlist is the culprit. Go the the spotify API documentation link below and test the query with limit = 50 offset = 0 on your own account (you need to be logged in): https://developer.spotify.com/documentation/web-api/reference/get-a-list-of-current-users-playlists Then Ctrl+F for "images": null