Delete Spotify playlist programmatically

Is it possible to delete a Spotify playlist using the JS API? I've created hundreds in error, but the API doesn't seem to have any obvious way of removing them.

Answers


You can, but it's really tedious.

See: https://developer.spotify.com/docs/apps/api/1.0/models-collection.html

myTracks.snapshot().done(function(snapshot) {
  myTracks.remove(snapshot.find(track));
});

replace "track" with playlist. You need something like:

library.forCurrentUser().playlists.snapshot(0,1).done(function(s) {
  library.forCurrentUser().playlists.remove(s.find(s.get(0)));
}

The gotacha here is that if you try to run this in a loop it will fail since the snapshot is stale the 2nd time it runs... very annoying.


Need Your Help

C# How to check if a class implements generic interface?

c# generics interface types

How to get generic interface type for an instance ?

How do you handle live video streaming in Flash AS3?

flash actionscript-3 sockets video-streaming

I've been dabbling with socket servers in Java and now I'm ready to get my feet wet with an idea I had.