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) {
setState(state=status.state);
if ('state' in status) {
setState(state=status.state);
}
if ('elapsed' in status) {
setTrackElapsed(status.elapsed);
}
if ('position' in status) {
setTrackElapsed(status.position);
}
};
var refreshTrack = function(track) {
setTrackTime(track.time);
if ('time' in track) {
setTrackTime(track.time);
}
$artistElement.text(track.artist);
$titleElement.text(track.title);
};