zmb3 / spotify

A Go wrapper for the Spotify Web API
Apache License 2.0
1.38k stars 294 forks source link

Missing fields from SimplePlaylist #200

Closed Sundava closed 2 years ago

Sundava commented 2 years ago

The SimplePlaylist model does not reflect what is returned from the Spotify API anymore. For example, a playlist returned from a call to https://api.spotify.com/v1/me/playlists looks like this:

https://api.spotify.com/v1/me/playlists ```json { "collaborative": false, "description": "Only the biggest Hardstyle tracks!", "external_urls": { "spotify": "https://open.spotify.com/playlist/37i9dQZF1DX0pH2SQMRXnC" }, "href": "https://api.spotify.com/v1/playlists/37i9dQZF1DX0pH2SQMRXnC", "id": "37i9dQZF1DX0pH2SQMRXnC", "images": [ { "height": null, "url": "https://i.scdn.co/image/ab67706f00000003ee492a8389b70e356a5d6f17", "width": null } ], "name": "Hardstyle Bangers", "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": null, "public": false, "snapshot_id": "MTY2MjY2MDMxNCwwMDAwMDAwMGYxODQwNzczMWZmNTM4ZTIyOGE4YzNlZmRmOTBmYjY3", "tracks": { "href": "https://api.spotify.com/v1/playlists/37i9dQZF1DX0pH2SQMRXnC/tracks", "total": 200 }, "type": "playlist", "uri": "spotify:playlist:37i9dQZF1DX0pH2SQMRXnC" } ```

We have three missing fields, namely:

Arguably only the description field is useful, I can make a PR for it soon enough

strideynet commented 2 years ago

I'd welcome a PR in this area - especially if you update the tests with some modern responses from the spotify API :)

According to Spotify, primary_color appears to be internal/unused, so let's ignore it for now. If we got the type wrong, we'd have to make a breaking release of the library to fix it.

strideynet commented 2 years ago

Closed in #202