Skip to content

Commit

Permalink
GMusicProxy plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jdwoody committed May 14, 2020
1 parent 2c2d5c6 commit 8e86e66
Show file tree
Hide file tree
Showing 9 changed files with 826 additions and 0 deletions.
64 changes: 64 additions & 0 deletions README.md
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
```
39 changes: 39 additions & 0 deletions plugins/music_service/gmusic_proxy/UIConfig.json
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"
}
]
}
]
}
14 changes: 14 additions & 0 deletions plugins/music_service/gmusic_proxy/config.json
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"
}
}
6 changes: 6 additions & 0 deletions plugins/music_service/gmusic_proxy/gmusic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions plugins/music_service/gmusic_proxy/i18n/strings_en.json
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"
}
Loading

0 comments on commit 8e86e66

Please sign in to comment.