From 0697598a86cf360bcf08018805e3c37b62f2da08 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Wed, 13 Feb 2019 00:32:14 +0100 Subject: [PATCH] Fixed music.js widget as well for the new mopidy backend --- platypush/backend/http/static/js/widgets/music.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/platypush/backend/http/static/js/widgets/music.js b/platypush/backend/http/static/js/widgets/music.js index 866ffa18..ab146501 100644 --- a/platypush/backend/http/static/js/widgets/music.js +++ b/platypush/backend/http/static/js/widgets/music.js @@ -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); };