go-libspotify icon indicating copy to clipboard operation
go-libspotify copied to clipboard

Panic when Playlist(int) is a PlaylistTypeStartFolder

Open fabiofalci opened this issue 10 years ago • 2 comments

Hi,

The library throws a panic when playlist is not PlaylistTypePlaylist or PlaylistTypePlaceholder.

https://github.com/op/go-libspotify/blob/master/spotify/libspotify.go#L1411

So it doesn't support PlaylistTypeStartFolder/PlaylistTypeEndFolder.

Is that designed or was just not investigated enough in how process PlaylistTypeStartFolder/PlaylistTypeEndFolder?

My issue if you want to look at it: https://github.com/fabiofalci/sconsify/issues/5

fabiofalci avatar May 11 '15 12:05 fabiofalci

Hi! I don't quite remember what my thoughts were for folders but it does look like I did (try to) add support for folders. If you determine the type by calling PlaylistType and for each folder you call Folder on that index.

I'm very open for suggestions on how to improve this.

op avatar May 12 '15 14:05 op

Ok! Nice one, I can check the type before. So I've included a fix for this: https://github.com/fabiofalci/sconsify/commit/1e03c6895f8d9049eae07b01a2c57fe1b023548c

It fixes my issue for now.

Eventually I'll want to include a more complete support for Folder, like group the playlists together, but for now it's enough.

So feel free to close this if you want.

fabiofalci avatar May 13 '15 10:05 fabiofalci