-
Notifications
You must be signed in to change notification settings - Fork 744
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
826 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,65 @@ | ||
# volumio-plugins | ||
|
||
## VSCode setup | ||
To set up Visual Studio Code for debugging plugin development, copy the code from your Volumio2 system to a local workspace: | ||
|
||
```bash | ||
cd [your workspace directory] | ||
# maybe change this to a mount... | ||
scp -r volumio@[volumio IP or Host]:/volumio/* . | ||
mkdir .vscode | ||
# for debugging | ||
echo '{ | ||
"version": "0.2.0", | ||
"configurations": [ { | ||
"type": "node", | ||
"request": "attach", | ||
"name": "Volumio2 Debugger", | ||
"address": "localhost", | ||
"port": "9229", | ||
"localRoot": "${workspaceFolder}/source", | ||
"remoteRoot": "/" | ||
} | ||
] | ||
}' > .vscode/launch.js | ||
``` | ||
|
||
### Running in debug mode | ||
|
||
You may need a few changes to cleanly debug. In the file `./app/index.js` | ||
|
||
```javascript | ||
// look for the logger instantiation | ||
this.logger = new (winston.Logger)({ | ||
transports: [ | ||
new (winston.transports.Console)(), | ||
new (winston.transports.File)({ | ||
filename: logfile, | ||
json: false | ||
}) | ||
] | ||
}); | ||
// enable winston debugging | ||
this.logger.level = 'debug'; | ||
``` | ||
|
||
In the file `./app/plugins/miscellanea/albumart/index.js`, you may need to modify the forked album art server | ||
to run on a different port: | ||
|
||
```javascript | ||
//Starting server | ||
var albumartServerCmdArray = [self.config.get('port'),self.config.get('folder')]; | ||
var pExecArgv = process.execArgv; | ||
if (typeof v8debug === 'object' || /--debug|--inspect/.test(process.execArgv.join(' '))) { | ||
pExecArgv = ['--inspect-brk=19229']; | ||
} | ||
var albumartServer = fork(__dirname+'/serverStartup.js', albumartServerCmdArray, { execArgv: pExecArgv }); | ||
``` | ||
|
||
Connect to your volumio box/vm and start up in debug mode | ||
|
||
```bash | ||
ssh -L 9229:localhost:9229 volumio@[volumio IP or Host] | ||
sudo systemctl stop volumio.service | ||
node --inspect-brk /volumio/index.js | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"page": { | ||
"label": "TRANSLATE.GMUSIC_CONFIGURATION" | ||
}, | ||
"sections": [ | ||
{ | ||
"id": "section_serverinfo", | ||
"element": "section", | ||
"label": "TRANSLATE.SERVER_INFO", | ||
"icon": "fa-plug", | ||
"onSave": {"type":"controller", "endpoint":"music_service/gmusic_proxy", "method":"saveGMusicConfig"}, | ||
"saveButton": { | ||
"label": "TRANSLATE.SAVE", | ||
"data": [ | ||
"address", | ||
"port" | ||
] | ||
}, | ||
"content": [ | ||
{ | ||
"id": "address", | ||
"type":"text", | ||
"element": "input", | ||
"doc": "This is the address of your GMusic Proxy server", | ||
"label": "TRANSLATE.GMUSIC_ADDRESS", | ||
"value": "" | ||
}, | ||
{ | ||
"id": "port", | ||
"type":"text", | ||
"element": "input", | ||
"doc": "This is the port of your GMusic Proxy server", | ||
"label": "TRANSLATE.GMUSIC_PORT", | ||
"value": "9999" | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"enabled": { | ||
"type": "boolean", | ||
"value": false | ||
}, | ||
"address": { | ||
"type": "string", | ||
"value": "" | ||
}, | ||
"port": { | ||
"type": "string", | ||
"value": "9999" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"PLUGIN_CONFIGURATION":"Example Plugin Configuration", | ||
"SAVE":"Save", | ||
"GMUSIC_ADDRESS":"GMusic Proxy Address", | ||
"GMUSIC_PORT":"GMusic Proxy Port" | ||
} |
Oops, something went wrong.