mirror of
https://github.com/SuperBFG7/ympd
synced 2025-01-13 10:50:36 +00:00
Fix: rm playlist
This commit is contained in:
parent
353417eded
commit
99efe12ed1
@ -1354,7 +1354,7 @@ function showMenu(el) {
|
||||
'<a class="dropdown-item" href="#" data-href="{\'cmd\': \'playlistDetails\', \'options\': [\'' + uri + '\']}">Edit playlist</a>' +
|
||||
'<a class="dropdown-item" href="#" data-href="{\'cmd\': \'showRenamePlaylist\', \'options\': [\'' + uri + '\']}">Rename playlist</a>' +
|
||||
'<a class="dropdown-item" href="#" data-href="{\'cmd\': \'delPlaylist\', \'options\': [\'' +
|
||||
uri + '\',\'' + name + '\']}">Delete playlist</a>';
|
||||
uri + '\']}">Delete playlist</a>';
|
||||
}
|
||||
else if (app.current.app == 'Browse' && app.current.tab == 'Playlists' && app.current.view == 'Detail') {
|
||||
menu += '<a class="dropdown-item" href="#" data-href="{\'cmd\': \'appendQueue\', \'options\': [\'' + type + '\',\'' +
|
||||
@ -1462,9 +1462,9 @@ function delQueueSong(mode, start, end) {
|
||||
sendAPI({"cmd": "MPD_API_RM_TRACK", "data": { "track": start}});
|
||||
}
|
||||
|
||||
function delPlaylist(plist, name) {
|
||||
sendAPI({"cmd": "MPD_API_RM_PLAYLIST", "data": {"plist": plist}});
|
||||
document.getElementById('BrowsePlaylistsList').querySelector('tr[data-uri=' + encodeURI(plist) + ']').remove();
|
||||
function delPlaylist(uri) {
|
||||
sendAPI({"cmd": "MPD_API_RM_PLAYLIST", "data": {"uri": uri}});
|
||||
document.getElementById('BrowsePlaylistsAllList').querySelector('tr[data-uri=' + encodeURI(uri) + ']').remove();
|
||||
}
|
||||
|
||||
function confirmSettings() {
|
||||
|
@ -412,7 +412,7 @@ void callback_mympd(struct mg_connection *nc, const struct mg_str msg)
|
||||
}
|
||||
break;
|
||||
case MPD_API_RM_PLAYLIST:
|
||||
je = json_scanf(msg.p, msg.len, "{ data: { plist:%Q } }", &p_charbuf1);
|
||||
je = json_scanf(msg.p, msg.len, "{ data: { uri:%Q } }", &p_charbuf1);
|
||||
if (je == 1) {
|
||||
mpd_run_rm(mpd.conn, p_charbuf1);
|
||||
free(p_charbuf1);
|
||||
|
Loading…
Reference in New Issue
Block a user