[GH-ISSUE #398] Playlists don't show up on the homepage #215

Closed
opened 2026-03-02 23:45:34 +03:00 by kerem · 6 comments
Owner

Originally created by @BinaryFly on GitHub (Mar 22, 2024).
Original GitHub issue: https://github.com/aome510/spotify-player/issues/398

The column to show playlists don't show up on the homepage

The backtrace is empty but the log gives me the following line:

2024-03-22T15:14:54.980917Z ERROR client_request{request=GetUserPlaylists}: spotify_player::client::handlers: Failed to handle client request: invalid type: null, expected u32 at line 1 column 7147

I found out which part of the returned json by the GetUserPlaylist request was problematic by looking up the column number and see what the problem was, I got this response by setting RUST_LOG=DEBUG and getting the log statement before the ERROR log.
This is the problematic part of the json where the "total" key in the returned "tracks" object is null, this makes spotify-player not show any playlists. all the other "total" keys of my playlists are a number on the other hand.

      {
         "collaborative":false,
         "description":"We made you a personalized playlist with songs to take you back in time.",
         "external_urls":{
            "spotify":"https://open.spotify.com/playlist/37i9dQZF1EuyeQlxxtnSue"
         },
         "href":"https://api.spotify.com/v1/playlists/37i9dQZF1EuyeQlxxtnSue",
         "id":"37i9dQZF1EuyeQlxxtnSue",
         "images":[
            {
               "height":null,
               "url":"https://daily-mix.scdn.co/covers/time-capsule/time-capsule-blue_DEFAULT-en.jpg",
               "width":null
            }
         ],
         "name":"Your Time Capsule",
         "owner":{
            "display_name":"Spotify",
            "external_urls":{
               "spotify":"https://open.spotify.com/user/spotify"
            },
            "href":"https://api.spotify.com/v1/users/spotify",
            "id":"spotify",
            "type":"user",
            "uri":"spotify:user:spotify"
         },
         "primary_color":"#ffffff",
         "public":true,
         "snapshot_id":"MTcxMTA2NTYwMCwwMDAwMDAwMDdkOTNiNDljY2RiNjgyNTM5MDA2YzE5OTcwZDQ3NmI1",
         "tracks":{
            "href":"https://api.spotify.com/v1/playlists/37i9dQZF1EuyeQlxxtnSue/tracks",
            "total":null
         },
         "type":"playlist",
         "uri":"spotify:playlist:37i9dQZF1EuyeQlxxtnSue"
      },

Seems like this is one of those special playlists made by spotify that somehow has a total of null tracks inside (maybe I didn't open the playlist yet)

image

Originally created by @BinaryFly on GitHub (Mar 22, 2024). Original GitHub issue: https://github.com/aome510/spotify-player/issues/398 The column to show playlists don't show up on the homepage The backtrace is empty but the log gives me the following line: ```log 2024-03-22T15:14:54.980917Z ERROR client_request{request=GetUserPlaylists}: spotify_player::client::handlers: Failed to handle client request: invalid type: null, expected u32 at line 1 column 7147 ``` I found out which part of the returned json by the GetUserPlaylist request was problematic by looking up the column number and see what the problem was, I got this response by setting RUST_LOG=DEBUG and getting the log statement before the ERROR log. This is the problematic part of the json where the "total" key in the returned "tracks" object is null, this makes spotify-player not show any playlists. all the other "total" keys of my playlists are a number on the other hand. ```json { "collaborative":false, "description":"We made you a personalized playlist with songs to take you back in time.", "external_urls":{ "spotify":"https://open.spotify.com/playlist/37i9dQZF1EuyeQlxxtnSue" }, "href":"https://api.spotify.com/v1/playlists/37i9dQZF1EuyeQlxxtnSue", "id":"37i9dQZF1EuyeQlxxtnSue", "images":[ { "height":null, "url":"https://daily-mix.scdn.co/covers/time-capsule/time-capsule-blue_DEFAULT-en.jpg", "width":null } ], "name":"Your Time Capsule", "owner":{ "display_name":"Spotify", "external_urls":{ "spotify":"https://open.spotify.com/user/spotify" }, "href":"https://api.spotify.com/v1/users/spotify", "id":"spotify", "type":"user", "uri":"spotify:user:spotify" }, "primary_color":"#ffffff", "public":true, "snapshot_id":"MTcxMTA2NTYwMCwwMDAwMDAwMDdkOTNiNDljY2RiNjgyNTM5MDA2YzE5OTcwZDQ3NmI1", "tracks":{ "href":"https://api.spotify.com/v1/playlists/37i9dQZF1EuyeQlxxtnSue/tracks", "total":null }, "type":"playlist", "uri":"spotify:playlist:37i9dQZF1EuyeQlxxtnSue" }, ``` Seems like this is one of those special playlists made by spotify that somehow has a total of `null` tracks inside (maybe I didn't open the playlist yet) ![image](https://github.com/aome510/spotify-player/assets/94313592/453ce2b3-6499-43f4-972c-f1f19ac42bc3)
kerem 2026-03-02 23:45:34 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@BinaryFly commented on GitHub (Mar 22, 2024):

So I just opened and closed this playlist on my phone's spotify app, and the total doesn't seem to get updated though unfortunately, I still get the same error.

<!-- gh-comment-id:2015360391 --> @BinaryFly commented on GitHub (Mar 22, 2024): So I just opened and closed this playlist on my phone's spotify app, and the total doesn't seem to get updated though unfortunately, I still get the same error.
Author
Owner

@aome510 commented on GitHub (Mar 22, 2024):

ahhh, another Spotify API type bug again. I can implement patch to workaround this issue. I do hope that Spotify makes their official API more "stable" sigh.

<!-- gh-comment-id:2015568480 --> @aome510 commented on GitHub (Mar 22, 2024): ahhh, another Spotify API type bug again. I can implement patch to workaround this issue. I do hope that Spotify makes their official API more "stable" _sigh_.
Author
Owner

@aome510 commented on GitHub (Mar 22, 2024):

It seems that this playlist belongs to Spotify. Can you try to remove and add the playlist back to your library again?

<!-- gh-comment-id:2015571639 --> @aome510 commented on GitHub (Mar 22, 2024): It seems that this playlist belongs to Spotify. Can you try to remove and add the playlist back to your library again?
Author
Owner

@BinaryFly commented on GitHub (Mar 22, 2024):

It seems that this playlist belongs to Spotify. Can you try to remove and add the playlist back to your library again?

Yeah that seems to have fixed the issue, now it correctly recognizes how many total tracks there are in this playlist and the issue doesn't show up again. weird how spotify reports null for the total before though.

<!-- gh-comment-id:2015642872 --> @BinaryFly commented on GitHub (Mar 22, 2024): > It seems that this playlist belongs to Spotify. Can you try to remove and add the playlist back to your library again? Yeah that seems to have fixed the issue, now it correctly recognizes how many total tracks there are in this playlist and the issue doesn't show up again. weird how spotify reports `null` for the total before though.
Author
Owner

@aome510 commented on GitHub (Mar 22, 2024):

Great to hear that it fixes the issue. Spotify API is a bit inconsistent. We recently encountered a few issues (https://github.com/ramsayleung/rspotify/issues/452) with their APIs.

I'll close this issue for now.

<!-- gh-comment-id:2015727710 --> @aome510 commented on GitHub (Mar 22, 2024): Great to hear that it fixes the issue. Spotify API is a bit inconsistent. We recently encountered a few issues (https://github.com/ramsayleung/rspotify/issues/452) with their APIs. I'll close this issue for now.
Author
Owner

@Icelk commented on GitHub (Apr 1, 2024):

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 "total": null is similar

<!-- gh-comment-id:2029555750 --> @Icelk commented on GitHub (Apr 1, 2024): 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 `"total": null` is similar
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-player#215
No description provided.