mirror of
https://github.com/SuperBFG7/ympd
synced 2024-12-26 11:00:27 +00:00
Feat: clear playback card if songpos = -1
This commit is contained in:
parent
dfe7e31a1e
commit
674ff60b09
@ -75,7 +75,7 @@
|
||||
<div class="card" id="cardPlayback">
|
||||
<div class="card-header">Playback</div>
|
||||
<div class="card-body">
|
||||
<div class="album-cover" id="album-cover"></div>
|
||||
<div class="album-cover" id="currentCover"></div>
|
||||
<h1 id="currentTrack" data-href="{'cmd': 'songClick', 'options': []}"></h1>
|
||||
<h3 id="currentArtist" data-href="{'cmd': 'artistClick', 'options': []}"></h3>
|
||||
<h4 id="currentAlbum"></h4>
|
||||
|
@ -905,6 +905,14 @@ function parseState(obj) {
|
||||
toggleBtn('btnoutput' + obj.data.outputs[i].id, obj.data.outputs[i].state);
|
||||
}
|
||||
|
||||
//clear playback card if not playing
|
||||
if (obj.data.songpos == '-1') {
|
||||
domCache.currentTrack.innerText = 'Not playing';
|
||||
document.getElementById('currentAlbum').innerText = '';
|
||||
document.getElementById('currentArtist').innerText = '';
|
||||
document.getElementById('currentCover').style.backgroundImage = '';
|
||||
}
|
||||
|
||||
last_state = obj;
|
||||
}
|
||||
|
||||
@ -1841,7 +1849,7 @@ function songChange(obj) {
|
||||
var htmlNotification = '';
|
||||
var pageTitle = 'myMPD: ';
|
||||
|
||||
document.getElementById('album-cover').style.backgroundImage = 'url("' + obj.data.cover + '")';
|
||||
document.getElementById('currentCover').style.backgroundImage = 'url("' + obj.data.cover + '")';
|
||||
|
||||
if (typeof obj.data.artist != 'undefined' && obj.data.artist.length > 0 && obj.data.artist != '-') {
|
||||
textNotification += obj.data.artist;
|
||||
|
Loading…
Reference in New Issue
Block a user