lordpengwin / muzak

Amazon Echo Skill for Logitech/Squeezebox Media Server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

java script failing when doing a replace on what looks like a Squeezebox name.

cthierman opened this issue · comments

Hi I'm really hoping you can help me,

So I've managed to get muzak Alexa function almost working.... But when I do a simple test of
"what is playing"
the function blows up with a
"TypeError: Connot read property 'replace' of undefined

It almost looks like it's tripping up on the fact that some of my squeezebox names have blanks in them.

Am I missing something, or is this actually a bug in the squeezenode code?

Here is some output from the console log, with app id replaced with xxxx:

2017-03-04T17:57:58.487Z 18fa40e8-0104-11e7-8a79-59166935dcbd getPlayers: {"result":[{"isplayer":1,"displaytype":"graphic-160x32","name":"Boom Box","canpoweroff":1,"playerid":"00:04:20:1e:46:51","model":"boom","ip":"192.168.1.100:35466","playerindex":"0","connected":1,"uuid":"273d0e60d66aef1f0ac1b84bbac097f5"},{"playerid":"00:04:20:06:84:21","model":"squeezebox3","ip":"192.168.1.32:24156","playeri

17:57:58
2017-03-04T17:57:58.488Z 18fa40e8-0104-11e7-8a79-59166935dcbd Got intent: {"name":"WhatsPlaying","slots":{"Player":{"name":"Player"}}}
2017-03-04T17:57:58.488Z 18fa40e8-0104-11e7-8a79-59166935dcbd Got intent:
{
"name": "WhatsPlaying",
"slots": {
"Player": {
"name": "Player"
}
}
}


17:57:58
2017-03-04T17:57:58.488Z 18fa40e8-0104-11e7-8a79-59166935dcbd Session is {"new":true,"sessionId":"SessionId.04e0a212-eb64-4815-b22c-7fc01571889a","application":{"applicationId":"amzn1.ask.skill.xxxx-xxx-xxxx-xxxx"},"attributes":{},"user":{"userId":"amzn1.ask.account.xxxxxxxxxxxxxxxxxxxxxx
17:57:58
2017-03-04T17:57:58.494Z 18fa40e8-0104-11e7-8a79-59166935dcbd TypeError: Cannot read property 'replace' of undefined at normalizePlayer (/var/task/muzak.js:568:28) at findPlayerObject (/var/task/muzak.js:540:12) at dispatchIntent (/var/task/muzak.js:150:22) at /var/task/muzak.js:121:17 at /var/task/node_modules/squeezenode-lordpengwin/server.js:80:13 at handle (/var/task/no

17:57:58

Found an issue with a routine and commented it out. seems to have fixed the problem.

commented

Hey cthierman,
What routine/line did you comment? Any other info you can provide for your specific implementation that would help correct the bug?

-Mike

I have a fix for this in this PR - https://github.com/MikeDeSantis/muzak/pull/3