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

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

Merged
merged 1 commit into from
Apr 1, 2024

Conversation

nicolasf
Copy link
Contributor

Makes playlist images an optional Vector.

Copy link
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
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
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
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
6 checks passed
@slovanos
Copy link

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