diff --git a/lib/playlist.js b/lib/playlist.js index 765d5ab8..e8ff7772 100644 --- a/lib/playlist.js +++ b/lib/playlist.js @@ -423,10 +423,12 @@ Playlist.prototype.clean = function (filter) { if (count < matches.length) { var uid = matches[count].uid; count++; - self.channel.sendAll("delete", { - uid: uid - }); - self.remove(uid, deleteNext); + if (self.remove(uid)) { + self.channel.sendAll("delete", { + uid: uid + }); + } + deleteNext(); } else { // refresh meta only once, at the end self.channel.broadcastPlaylistMeta();