all working

This commit is contained in:
Karl 2020-03-09 10:40:27 +00:00
parent 5861f6bf05
commit 2ed2207f46
2 changed files with 9 additions and 4 deletions

9
.vscode/launch.json vendored
View File

@ -31,6 +31,15 @@
"program": "${workspaceFolder}/player.js",
"args":["url", "https://open.spotify.com/album/0sHibspyMdqOB4RsaCsG8X"]
},
{
"type": "node",
"request": "launch",
"name": "Player Pause",
"skipFiles": [
],
"program": "${workspaceFolder}/player.js",
"args":["pause"]
},
{
"type": "node",
"request": "launch",

View File

@ -103,10 +103,8 @@ async function playFile() {
let body;
try {
if (lastPlayer.includes(album)) {
console.log('same disk')
body = {}
} else {
console.log('different disk')
body = {
"context_uri": album,
"offset": {
@ -132,12 +130,10 @@ async function playFile() {
},
});
} catch (e) {
console.log('something went wrong')
throw Error(`Request error: ${e}`);
}
this.response = response;
this.response.body = response.body
console.log('all good')
}
async function playURL() {