From a7204fc7d572e685cf591ccc941c35f8ff7cf322 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 24 Aug 2013 03:09:06 -0400 Subject: [PATCH] fix parse error when mpd is in stopped state due to the time field not being included --- main.js | 7 ++++++- manifest.json | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index 7e12e9f..1e83a3b 100644 --- a/main.js +++ b/main.js @@ -239,7 +239,12 @@ function update_ui(state, cmd) { return; } - var time = state.time.split(':'); + var time; + if ('time' in state) + // When stopped, there is no time field at all. + time = state.time.split(':'); + else + time = [0, 0]; window['ui_mpc_seekcur'].max = time[1]; window['ui_mpc_seekcur'].value = time[0]; diff --git a/manifest.json b/manifest.json index 14453b1..605208f 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "minimum_chrome_version": "24", "name": "Music Player Client", - "version": "1.0.1", + "version": "2.0", "description": "Control a Music Player Daemon (MPD)", "icons": { "128": "images/icon-128x128.png" -- 2.39.5