Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Music Plugin using GMusicProxy #283

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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