1
0
mirror of https://github.com/SuperBFG7/ympd synced 2025-10-20 08:37:39 +00:00

Feat: add rescan database command

This commit is contained in:
jcorporation
2018-09-23 22:48:12 +01:00
parent 006eb6d28c
commit f71bef42fe
5 changed files with 36 additions and 1 deletions

View File

@@ -309,6 +309,16 @@ function appInit() {
sendAPI({"cmd": "MPD_API_PLAYER_SEEK", "data": {"songid": currentSong.currentSongId, "seek": seekVal}});
}
}, false);
document.getElementById('navDBupdate').addEventListener('click', function(event) {
event.stopPropagation();
event.preventDefault();
var icon = this.getElementsByTagName('span')[0];
if (icon.innerText == 'keyboard_arrow_right')
icon.innerText = 'keyboard_arrow_down';
else
icon.innerText = 'keyboard_arrow_right';
}, false);
document.getElementById('volumeIcon').parentNode.addEventListener('show.bs.dropdown', function () {
sendAPI({"cmd": "MPD_API_PLAYER_OUTPUT_LIST"}, parseOutputs);
@@ -1840,6 +1850,11 @@ function updateDB() {
updateDBstarted(true);
}
function rescanDB() {
sendAPI({"cmd": "MPD_API_DATABASE_RESCAN"});
updateDBstarted(true);
}
function updateDBstarted(showModal) {
if (showModal == true) {
document.getElementById('updateDBfinished').innerText = '';