Closed brodin closed 4 years ago
Thanks!
@zmb3 I found an issue with this.
If you explicitly send in nil
as album type this will crash. This since ts
then will have length 1 and this loop will result in a nil-pointer https://github.com/zmb3/spotify/pull/116/files#diff-234075626fc63bfff8ccab16d40509e9R124
So the code is not fully backwards compatible. Do you want me to add a guard for it?
The guard would be to change this line https://github.com/zmb3/spotify/pull/116/files#diff-234075626fc63bfff8ccab16d40509e9R121 to
if ts != nil && ts[0] != nil
then we should be fully backwards compatible.
@brodin sure. Note that you don't even need the if ts != nil
check, as you can range over a nil slice, and the loop simply won't execute.
This API will be backwards compatible, but also support the full potential of the underlying endpoint. See https://developer.spotify.com/documentation/web-api/reference/artists/get-artists-albums/ for reference