From f0f6d43990aaae0018ab954dafbcc9e9d3a8c2ad Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Tue, 12 Feb 2019 23:59:13 +0100 Subject: [PATCH] Using the right naming for length and elapsed variables --- platypush/backend/http/static/js/music.mpd.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/platypush/backend/http/static/js/music.mpd.js b/platypush/backend/http/static/js/music.mpd.js index 3142f6677e..cca27124e8 100644 --- a/platypush/backend/http/static/js/music.mpd.js +++ b/platypush/backend/http/static/js/music.mpd.js @@ -56,20 +56,18 @@ $(document).ready(function() { } if ('time' in status) { - var time; var elapsed; - if (typeof status.time === 'string' && status.time.indexOf(':') > -1) { // backend.music.mpd time format: "elapsed:total" - [elapsed, time] = status.time.split(':'); + [elapsed, length] = status.time.split(':'); elapsed = parseInt(elapsed); - time = parseInt(time); + length = parseInt(length); } else { // backend.music.mopidy time format: integer with elapsed seconds - time = parseInt(status.time); + length = parseInt(status.time); } - if (time) { - $trackSeeker.val(time); + if (length) { + $trackSeeker.val(length); } if (elapsed) {