forked from svrooij/node-sonos-ts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontent.js
More file actions
23 lines (20 loc) · 671 Bytes
/
Copy pathcontent.js
File metadata and controls
23 lines (20 loc) · 671 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const SonosDevice = require('../lib').SonosDevice
const sonos = new SonosDevice(process.env.SONOS_HOST || '192.168.96.56')
// sonos.GetQueue()
// .then(resp => {
// console.log(resp)
// })
// .catch(console.error)
// Search for artist eminem
sonos.ContentDirectoryService.BrowseParsedWithDefaults('A:ARTIST:eminem')
.then(async resp => {
// You will now have the artist reference in the ItemId, this can be used to do a new call.
if (resp.NumberReturned > 0) {
return sonos.ContentDirectoryService.BrowseParsedWithDefaults(resp.Result[0].ItemId)
}
return resp
})
.then(resp => {
console.log(resp)
})
.catch(console.error)