{"action":"created","issue":{"url":"https://api.github.com/repos/htilly/zenmusic/issues/4","repository_url":"https://api.github.com/repos/htilly/zenmusic","labels_url":"https://api.github.com/repos/htilly/zenmusic/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/htilly/zenmusic/issues/4/comments","events_url":"https://api.github.com/repos/htilly/zenmusic/issues/4/events","html_url":"https://github.com/htilly/zenmusic/issues/4","id":168218722,"number":4,"title":"crash when adding music / package.json not up-to-date ?","user":{"login":"JeromeBouvard","id":1897662,"avatar_url":"https://avatars.githubusercontent.com/u/1897662?v=3","gravatar_id":"","url":"https://api.github.com/users/JeromeBouvard","html_url":"https://github.com/JeromeBouvard","followers_url":"https://api.github.com/users/JeromeBouvard/followers","following_url":"https://api.github.com/users/JeromeBouvard/following{/other_user}","gists_url":"https://api.github.com/users/JeromeBouvard/gists{/gist_id}","starred_url":"https://api.github.com/users/JeromeBouvard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JeromeBouvard/subscriptions","organizations_url":"https://api.github.com/users/JeromeBouvard/orgs","repos_url":"https://api.github.com/users/JeromeBouvard/repos","events_url":"https://api.github.com/users/JeromeBouvard/events{/privacy}","received_events_url":"https://api.github.com/users/JeromeBouvard/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-28T23:19:14Z","updated_at":"2016-07-29T18:23:16Z","closed_at":null,"body":"Hi !\r\ni am trying to set up the server in our office.\r\n\r\n1/ it seems that the package.json is not up-to-date, as the node-sonos is still on 0.11.x.\r\n2/ if I update the node-sones library , it crashes.\r\n\r\nCould you try to do your sequence on a brand new fresh computer ? I tried on 3 different and have same result : \r\n\r\n\r\ngit clone https://github.com/htilly/zenmusic\r\ncd zenmusic\r\nnpm install (should be wrong due to bad version of node-sonos)\r\nChange all the values in \"config.json\".\r\nnode index.js\r\n\r\nnothing else to do ? patching some files ?\r\n\r\nthanks !\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/htilly/zenmusic/issues/comments/236256322","html_url":"https://github.com/htilly/zenmusic/issues/4#issuecomment-236256322","issue_url":"https://api.github.com/repos/htilly/zenmusic/issues/4","id":236256322,"user":{"login":"htilly","id":582460,"avatar_url":"https://avatars.githubusercontent.com/u/582460?v=3","gravatar_id":"","url":"https://api.github.com/users/htilly","html_url":"https://github.com/htilly","followers_url":"https://api.github.com/users/htilly/followers","following_url":"https://api.github.com/users/htilly/following{/other_user}","gists_url":"https://api.github.com/users/htilly/gists{/gist_id}","starred_url":"https://api.github.com/users/htilly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htilly/subscriptions","organizations_url":"https://api.github.com/users/htilly/orgs","repos_url":"https://api.github.com/users/htilly/repos","events_url":"https://api.github.com/users/htilly/events{/privacy}","received_events_url":"https://api.github.com/users/htilly/received_events","type":"User","site_admin":false},"created_at":"2016-07-29T18:23:16Z","updated_at":"2016-07-29T18:23:16Z","body":"Sorry. My bad. U need to add two functions to node-sonos. \r\nIt has been added in the repro.\r\nSee:\r\nhttps://github.com/bencevans/node-sonos/commit/bfb995610c8aa20bda09e370b0f5d31ba0caa6a0\r\n\r\nSo, please add the following lines in this file:\r\n**node_modules/sonos/lib/sonos.js**\r\n\r\nSonos.prototype.addSpotifyQueue = function(track_id, callback) {\r\nvar rand = '00030020'\r\nvar uri = 'x-sonos-spotify:spotify%3atrack%3a' + track_id\r\nvar meta = 'dc:title/dc:titleupnp:classobject.item.audioItem.musicTrack/upnp:classSA_RINCON2311_X_#Svc2311-0-Token'\r\n\r\nthis.queue({\r\nuri: uri,\r\nmetadata: meta\r\n}, callback)\r\n}\r\n\r\nSonos.prototype.getQueue = function (callback) {\r\nvar self = this\r\n\r\nvar defaultOptions = {\r\nBrowseFlag: 'BrowseDirectChildren',\r\nFilter: '*',\r\nStartingIndex: '0',\r\nRequestedCount: '1000',\r\nSortCriteria: ''\r\n}\r\n\r\nvar opts = {\r\nObjectID: 'Q:0'\r\n}\r\n\r\nopts = _.extend(defaultOptions, opts)\r\n\r\nvar contentDirectory = new Services.ContentDirectory(this.host, this.port)\r\nreturn contentDirectory.Browse(opts, function (err, data) {\r\nconsole.log(err)\r\nconsole.log(data)\r\nif (err) return callback(err)\r\nreturn (new xml2js.Parser()).parseString(data.Result, function (err, didl) {\r\nif (err) return callback(err, data)\r\nvar items = []\r\nif ((!didl) || (!didl['DIDL-Lite'])) {\r\nreturn callback(new Error('Cannot parse DIDTL result'), data)\r\n}\r\nvar resultcontainer = didl['DIDL-Lite'].item\r\nif (!util.isArray(resultcontainer)) {\r\nreturn callback(new Error('Cannot parse DIDTL result'), data)\r\n}\r\n.each(resultcontainer, function (item) {\r\nvar albumArtURL = null\r\nif (util.isArray(item['upnp:albumArtURI'])) {\r\nif (item['upnp:albumArtURI'][0].indexOf('http') !== -1) {\r\nalbumArtURL = item['upnp:albumArtURI'][0]\r\n} else {\r\nalbumArtURL = 'http://' + self.host + ':' + self.port + item['upnp:albumArtURI'][0]\r\n}\r\n}\r\nitems.push({\r\n'title': util.isArray(item['dc:title']) ? item['dc:title'][0] : null,\r\n'artist': util.isArray(item['dc:creator']) ? item['dc:creator'][0] : null,\r\n'albumArtURL': albumArtURL,\r\n'album': util.isArray(item['upnp:album']) ? item['upnp:album'][0] : null,\r\n'uri': util.isArray(item.res) ? item.res[0]. : null\r\n})\r\n})\r\nvar result = {\r\nreturned: data.NumberReturned,\r\ntotal: data.TotalMatches,\r\nitems: items\r\n}\r\nreturn callback(null, result)\r\n})\r\n})\r\n}"}}
{"actor":{"display_login":"htilly"}}