Using the right naming for length and elapsed variables
This commit is contained in:
parent
71c6ba2d34
commit
f0f6d43990
1 changed files with 5 additions and 7 deletions
|
@ -56,20 +56,18 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('time' in status) {
|
if ('time' in status) {
|
||||||
var time; var elapsed;
|
|
||||||
|
|
||||||
if (typeof status.time === 'string' && status.time.indexOf(':') > -1) {
|
if (typeof status.time === 'string' && status.time.indexOf(':') > -1) {
|
||||||
// backend.music.mpd time format: "elapsed:total"
|
// backend.music.mpd time format: "elapsed:total"
|
||||||
[elapsed, time] = status.time.split(':');
|
[elapsed, length] = status.time.split(':');
|
||||||
elapsed = parseInt(elapsed);
|
elapsed = parseInt(elapsed);
|
||||||
time = parseInt(time);
|
length = parseInt(length);
|
||||||
} else {
|
} else {
|
||||||
// backend.music.mopidy time format: integer with elapsed seconds
|
// backend.music.mopidy time format: integer with elapsed seconds
|
||||||
time = parseInt(status.time);
|
length = parseInt(status.time);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (time) {
|
if (length) {
|
||||||
$trackSeeker.val(time);
|
$trackSeeker.val(length);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (elapsed) {
|
if (elapsed) {
|
||||||
|
|
Loading…
Reference in a new issue