Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't select STORED_MUSIC #9

Open
theovassiliou opened this issue Feb 14, 2018 · 0 comments
Open

Can't select STORED_MUSIC #9

theovassiliou opened this issue Feb 14, 2018 · 0 comments

Comments

@theovassiliou
Copy link

server.js crashes when trying to select a STORED_MUSIC with the following error messages:

SoundTouch-NodeJS/api.js:382
handler(json);
 ^
TypeError: handler is not a function
   at Request._callback (/Users/the/Google Drive Privat/Coding/soundtouch/node-soundtouch/SoundTouch-NodeJS/api.js:382:9)
   at Request.self.callback (/Users/the/Google Drive Privat/Coding/soundtouch/node-soundtouch/SoundTouch-NodeJS/node_modules/request/request.js:186:22)
   at emitTwo (events.js:126:13)
   at Request.emit (events.js:214:7)
   at Request.<anonymous> (/Users/the/Google Drive Privat/Coding/soundtouch/node-soundtouch/SoundTouch-NodeJS/node_modules/request/request.js:1163:10)
   at emitOne (events.js:116:13)
   at Request.emit (events.js:211:7)
   at IncomingMessage.<anonymous> (/Users/the/Google Drive Privat/Coding/soundtouch/node-soundtouch/SoundTouch-NodeJS/node_modules/request/request.js:1085:12)
   at Object.onceWrapper (events.js:313:30)
   at emitNone (events.js:111:20)

What I sent was:

localhost:5006/Office/select/STORED_MUSIC/55076f6e-6b79-1d65-a4eb-00089bea8bd7%2F0/0%241%2417%243338%2421161

I got the information out of:

OW PLAYING UPDATED { nowPlaying: 
{ deviceID: '08DF1F1A065C',
 source: 'STORED_MUSIC',
 sourceAccount: '55076f6e-6b79-1d65-a4eb-00089bea8bd7/0',
 ContentItem: 
  { source: 'STORED_MUSIC',
    location: '0$1$17$3338$21001',
    sourceAccount: '55076f6e-6b79-1d65-a4eb-00089bea8bd7/0',
    isPresetable: 'true',
    itemName: 'Bla bla' }
....

So I urlencoded the sourceAccount valueand the location to the above mentioned REST call.
Interestingly I saw by using the sample.js

NOW SELECTION UPDATED { preset: 
{ id: '0',
 ContentItem: 
  { source: 'STORED_MUSIC',
    type: '55076f6e-6b79-1d65-a4eb-00089bea8bd7/0',
    location: 'function %28json%29 {\n        res.json%28json%29;\n    }',
    sourceAccount: '0$1$17$3338$21161',
    isPresetable: 'true',
    itemName: 'Select using API' } } }
NOW PLAYING UPDATED { nowPlaying: 
 { deviceID: '08DF1F1A065C',
 source: 'INVALID_SOURCE',
 ContentItem: { source: 'INVALID_SOURCE', isPresetable: 'true' } } }
Powered On
Not playing

As it looks some source code is passed into the REST call (see location). The sourceAccount while decoded correctly was displayed in type. So I guess something is beeing mixed up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant