zmb3 / spotify

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

Make spotify.PlaybackOffset.Position an *int #220

Closed aditya-K2 closed 1 year ago

aditya-K2 commented 1 year ago

Fixes #219

https://github.com/zmb3/spotify/commit/9d29507c9a13689c913905f76e69974e8b234072 changed the JSON tag of the PlaybackOffset.Position resulting in it not being ignored when only URI was set. Which lead to the error mentioned #219. This PR fixes this by making PlaybackOffset.Position an integer pointer, hence it won't be ignored when it will be zero and will be ignored when only URI is set.

aditya-K2 commented 1 year ago

Any updates on this?

strideynet commented 1 year ago

Any updates on this?

This is a breaking change to the API of the client. I'll have a think if we want to merge this as-is and do a breaking release or if we'll need to come up with a different solution that still allows this to be controlled.

aditya-K2 commented 1 year ago

This is a breaking change to the API of the client. I'll have a think if we want to merge this as-is and do a breaking release or if we'll need to come up with a different solution that still allows this to be controlled.

I understand that this is a breaking change to the API of the client, but I believe that the existing code is not functioning as expected, and this will only bring the library in line with the Spotify API specifications.

strideynet commented 1 year ago

Yeah I agree, can you update the comment to explain what the behaviour is if this is nil and when a value is provided ?

aditya-K2 commented 1 year ago

Yeah I agree, can you update the comment to explain what the behaviour is if this is nil and when a value is provided ?

Sure.