spotify
spotify copied to clipboard
Cannot Set Playlist Image With Autoretry
Version
- Go:
go version go1.17.5 windows/amd64
-
github.com/zmb3/spotify/v2
:v2.0.1
Issue
When I invoke client.SetPlaylistImage
without client.WithRetry
, everything works and the playlist image updates. When I invoke client.SetPlaylistImage
with client.WithRetry
, the playlist image is updated but client.SetPlaylistImage
returns "io: read/write on closed pipe"
.
Expected Behavior
client.SetPlaylistImage
should work the same with or without autoretry
Possible Cause
The API endpoint (PUT /playlists/{playlist_id}/images
) returns 202 Accepted
(Regardless if autoretry is enabled or not) which is then retried because of shouldRetry
. The reason that it works without autoretry is this if statement. I'm not entirely sure if the problem is Spotify returning an unexpected response (Please note that this library seems to anticipate the 202 response here) or the condition in shouldRetry
.
It seems this may have been discussed in #100 (Specifically this comment)