Skip to content

Commit

Permalink
Merge pull request #508 from svrooij/bugfixes-2021-03
Browse files Browse the repository at this point in the history
Bugfixes 2021 03
svrooij authored Mar 17, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 16c64e1 + b499043 commit 010dafe
Showing 7 changed files with 255 additions and 6,049 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -8,7 +8,8 @@ node_modules
typings

# VS
.vscode
.vscode/*.json
!.vscode/launch.json
config/*local.json

# Ignore Mac DS_Store files
21 changes: 21 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch current example",
"program": "${file}",
"skipFiles": [
"<node_internals>/**"
],
"env": {
"DEBUG":"sonos:*",
"SONOS_HOST":"192.168.96.56"
},
}
]
}
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -76,8 +76,7 @@ DeviceDiscovery().once('DeviceAvailable', (device) => {
console.log('found device at ' + device.host)

// get all groups
sonos = new Sonos(device.host)
sonos.getAllGroups().then(groups => {
device.getAllGroups().then(groups => {
groups.forEach(group => {
console.log(group.Name);
})
9 changes: 9 additions & 0 deletions lib/helpers.js
Original file line number Diff line number Diff line change
@@ -187,6 +187,14 @@ Helpers.GenerateMetadata = function (uri, title = '', region = '3079') {
.replace('##SPOTIFYTYPE##', 'object.container.playlistContainer')
.replace('##PARENTID##', '')
}
} else if (uri.startsWith('spotify:playlist:')) { // Playlist
return {
uri: 'x-rincon-cpcontainer:1006206c' + spotifyUri,
metadata: meta.replace('##SPOTIFYURI##', '1006206c' + spotifyUri)
.replace('##RESOURCETITLE##', '')
.replace('##SPOTIFYTYPE##', 'object.container.album.playlistContainer')
.replace('##PARENTID##', '')
}
} else if (uri.startsWith('spotify:user:')) {
return {
uri: 'x-rincon-cpcontainer:10062a6c' + spotifyUri + '?sid=9&flags=10860&sn=7',
@@ -276,6 +284,7 @@ Helpers.ParseDIDLItem = function (item, host, port, trackUri) {
title: item['r:streamContent'] || item['dc:title'] || null,
artist: item['dc:creator'] || null,
album: item['upnp:album'] || null,
albumArtist: item['r:albumArtist'] || null,
albumArtURI
}
if (trackUri) track.uri = trackUri
2 changes: 1 addition & 1 deletion lib/sonos.js
Original file line number Diff line number Diff line change
@@ -118,7 +118,7 @@ Sonos.prototype.searchMusicLibrary = async function (searchType, searchTerm, req
let searches = `${searchTypes[searchType]}${separator}`

if (searchTerm && searchTerm !== '') {
searches = searches.concat(encodeURIComponent(searchTerm))
searches = searches.concat(searchType === 'share' ? searchTerm : encodeURIComponent(searchTerm))
}

var opts = {
6,260 changes: 219 additions & 6,041 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@
"lint": "standard",
"test": "npm run lint && mocha test/sonos.test.js --exit --timeout 20000",
"env-run": "npm run $CMD",
"semantic-release": "semantic-release",
"docs": "jsdox -t ./docs/generator/templates --output docs lib/ && jsdox -t ./docs/generator/templates --output docs/services lib/services && jsdox -t ./docs/generator/templates --output docs/events lib/events"
},
"repository": {
@@ -44,9 +43,9 @@
"license": "MIT",
"dependencies": {
"axios": "^0.21.1",
"debug": "^4.1.1",
"debug": "^4.3.1",
"ip": "^1.1.5",
"xml2js": "^0.4.19"
"xml2js": "^0.4.23"
},
"bugs": {
"url": "http://github.com/bencevans/node-sonos/issues"
@@ -56,7 +55,6 @@
"mocha": "6.2.0",
"nock": "10.0.6",
"pre-commit": "1.2.2",
"semantic-release": "17.2.3",
"standard": "13.1.0"
},
"pre-commit": [

0 comments on commit 010dafe

Please sign in to comment.