alaingilbert / Turntable-API

Allows you to create bots for turntable.fm
http://alaingilbert.github.com/Turntable-API/
MIT License
317 stars 98 forks source link

Proper way to use bot.playlistRemove #95

Closed sneader closed 11 years ago

sneader commented 12 years ago

I'd like to be able to remove the song that the bot is currently playing, or if that is not possible, remove the song that the bot just played (i.e. wait till he is done playing the song, then remove it).

If I issue bot.playlistRemove() during the song, will that work? (defaulting to index of 0, which I believe is the top of the queue)?

Short of that, could/should I remove the song from the bottom of the queue, by calculating the total queue size and setting the index to that number (minus 1?)

Sorry for newbie questions. :-) And TIA!

MikeWills commented 12 years ago

I don't believe you can remove the current song you are playing on the web interface, so you won't be able to remove the current playing song. If you want to remove the song that just played, just get the length of your songlist array and use the last index - 1.

sneader commented 11 years ago

Thanks Mike, it worked great!!

MikeWills commented 11 years ago

@alaingilbert you should be able to close this as well.

alaingilbert commented 11 years ago

Thanks @MikeWills :)