If we haven't connected yet, then "mpc" won't be available.
Don't kill ourselves over it.
if (typeof(page) != 'string')
page = this.id.split('.')[1];
if (typeof(page) != 'string')
page = this.id.split('.')[1];
+ // We might not be connected in which case 'mpc' will be undefined.
switch (page) {
case 'playlist':
switch (page) {
case 'playlist':
+ if (mpc)
+ mpc.playlistinfo();
// Fallthrough.
case 'metadata':
// Fallthrough.
case 'metadata':
+ if (mpc)
+ mpc.currentsong();