1
0
mirror of https://github.com/SuperBFG7/ympd synced 2025-10-28 04:17:40 +00:00

Feat: add all from search to a playlist

This commit is contained in:
jcorporation
2018-07-31 23:01:10 +01:00
parent d6a24d4531
commit 712966348e
3 changed files with 14 additions and 25 deletions

View File

@@ -432,8 +432,8 @@
</form>
<div class="input-group mr-2">
<div class="input-group-prepend">
<button id="searchAddAllSongs" class="btn btn-secondary rounded-right" data-href="{'cmd': 'addAllFromSearch', 'options': []}">Add all</button>
<button id="searchAddAllSongsBtn" class="btn btn-secondary dropdown-toggle dropdown-toggle-split rounded-right hide" type="button" data-toggle="dropdown"></button>
<button id="searchAddAllSongs" class="btn btn-secondary" data-href="{'cmd': 'addAllFromSearch', 'options': []}">Add all</button>
<button id="searchAddAllSongsBtn" class="btn btn-secondary dropdown-toggle dropdown-toggle-split rounded-right" type="button" data-toggle="dropdown"></button>
<div class="dropdown-menu bg-dark dropdown-menu-right px-2" id="searchAddAllSongsDropdown">
<button type="button" class="btn btn-secondary btn-block">Add all to queue</button>
<button type="button" class="btn btn-secondary btn-block">Add all to playlist</button>

View File

@@ -1684,7 +1684,11 @@ function addAllFromSearch() {
function addAllFromSearchPlist(plist) {
if (app.current.search.length >= 2) {
sendAPI({"cmd":"MPD_API_SEARCH_ADD_PLIST", "data":{ "plist": plist, "filter": app.current.filter, "searchstr": app.current.search}});
var filter = app.current.filter;
if (filter == 'Any Tag')
filter = 'any';
sendAPI({"cmd":"MPD_API_SEARCH_ADD_PLIST", "data":{ "plist": plist, "filter": filter, "searchstr": app.current.search}});
showNotification('Added '+ parseInt(document.getElementById('panel-heading-search').innerText) +' songs from search to ' + plist, '', '', 'success');
}
}