Skip to content

fix #461: No playlist on psst-gui and failed to read json error#464

Merged
jacksongoode merged 1 commit intojpochyla:masterfrom
nicolasf:fix_playlist_json_error
Apr 1, 2024
Merged

fix #461: No playlist on psst-gui and failed to read json error#464
jacksongoode merged 1 commit intojpochyla:masterfrom
nicolasf:fix_playlist_json_error

Conversation

@nicolasf
Copy link
Copy Markdown
Contributor

Makes playlist images an optional Vector.

Copy link
Copy Markdown
Collaborator

@Insprill Insprill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM at a glance, Thank you! I can't test this right now, so I'll wait for someone else to sign off before merging.

@jacksongoode
Copy link
Copy Markdown
Collaborator

Though I hadn't had this error before, this build does work for me. Was there a way to reproduce it?

@nicolasf
Copy link
Copy Markdown
Contributor Author

nicolasf commented Apr 1, 2024

One reproducer for me is having an empty playlist, which I might have created by mistake using Spotify's app.
As Spotify doesn't have any tracks to choose an image it's returning null on "images".

Here's a snippet of the playlists json from Spotify. I've redacted some fields for privacy:

{
      "collaborative": false,
      "description": "",
      "external_urls": {
        "spotify": "https://open.spotify.com/playlist/MY_PLAYLIST_ID"
      },
      "href": "https://api.spotify.com/v1/playlists/MY_PLAYLIST_ID",
      "id": "MY_PLAYLIST_ID",
      "images": null,
      "name": "My Playlist #66",
      "owner": {
        "display_name": "Nicolas",
        "external_urls": {
          "spotify": "https://open.spotify.com/user/MY_USER_ID"
        },
        "href": "https://api.spotify.com/v1/users/MY_USER_ID",
        "id": "MY_USER_ID",
        "type": "user",
        "uri": "spotify:user:MY_USER_ID"
      },
      "primary_color": null,
      "public": true,
      "snapshot_id": "SNAPSHOT_ID",
      "tracks": {
        "href": "https://api.spotify.com/v1/playlists/MY_PLAYLIST_ID/tracks",
        "total": 0
      },
      "type": "playlist",
      "uri": "spotify:playlist:MY_PLAYLIST_ID"
    }

@jacksongoode
Copy link
Copy Markdown
Collaborator

@nicolasf I can confirm that an empty playlist will trigger this in main and this PR resolves that!

@jacksongoode jacksongoode merged commit 37d8da1 into jpochyla:master Apr 1, 2024
@slovanos
Copy link
Copy Markdown

slovanos commented Apr 1, 2024

Nice work @nicolasf thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants