Fixed music.js widget as well for the new mopidy backend

This commit is contained in:
Fabio Manganiello 2019-02-13 00:32:14 +01:00
parent 3190d3c6c8
commit 0697598a86

View file

@ -105,14 +105,24 @@ $(document).ready(function() {
}; };
var refreshStatus = function(status) { var refreshStatus = function(status) {
if ('state' in status) {
setState(state=status.state); setState(state=status.state);
}
if ('elapsed' in status) { if ('elapsed' in status) {
setTrackElapsed(status.elapsed); setTrackElapsed(status.elapsed);
} }
if ('position' in status) {
setTrackElapsed(status.position);
}
}; };
var refreshTrack = function(track) { var refreshTrack = function(track) {
if ('time' in track) {
setTrackTime(track.time); setTrackTime(track.time);
}
$artistElement.text(track.artist); $artistElement.text(track.artist);
$titleElement.text(track.title); $titleElement.text(track.title);
}; };