If i add a playlist that already exists. I.E: I add a playlist with the name test, i then try to add another playlist forgetting i already named one test but when i try add test it doesnt add it or replaces, not sure.
But i want it to display a message saying it already exists!
Thing is, it doesnt return true or false.. Not sure what it returns and cant find the save command reference. I checked command/index.php but not in there.
My code:
- Code: Select all
$('#modal-pl-save-btn').click(function(){
var playlistname = $('#pl-save-name').val();
if (playlistname != "")
{
if (sendCmd('save "' + playlistname + '"'))
{
new PNotify({
title: 'Success',
text: 'Playlist Added',
icon: 'fa fa-check',
delay: 3000
});
}
else
{
new PNotify({
title: 'Error',
text: 'Playlist Exists!',
icon: 'fa fa-exclamation-circle',
delay: 3000
});
}
}
else
{
new PNotify({
title: 'Warning',
text: 'Please Input A Name',
icon: 'fa fa-exclamation-circle',
delay: 3000
});
}
});