Skip to content

Instantly share code, notes, and snippets.

@alaingilbert
Created September 26, 2011 21:45
Show Gist options
  • Save alaingilbert/1243498 to your computer and use it in GitHub Desktop.
Save alaingilbert/1243498 to your computer and use it in GitHub Desktop.
Remove a large playlist on turntable.fm
// Remove the current playlist
var files = turntable.playlist.files;
var arr = [];
for (var i=0, len=files.length; i<len; i++) {
arr.push(files[i].fileId);
}
function remRec(arr) {
var fileId = arr.splice(0, 1)[0];
turntable.playlist.removeFile(fileId);
if (arr.length > 0) {
setTimeout(function () { remRec(arr); }, 1500);
}
}
remRec(arr);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment