Music services development guidelines

Hello team,
And thank you for all the work accomplished on Volumio 2.

I’m trying to code some Google Play Music service and must admit I’m struggling with very basic task like activating my plugin. I edited /volumio/app/plugins/plugins.json with no luck. Is there some documentation to help with such development tasks since github wiki does not help that much.

Hi, have a look at plugin repo on github. You have nothing to edit if you use the dev branch of volumio as it included a plugin installation mechanism.

TU! I’ll have a look at this repo and switch to dev branch tonight.

Use the Spotify -spop plugin as model. The other are not ready…

I’ll do as you say. Thank you for advice.
The Web-UI “plugin” menu doesn’t seem to be ready, can we use it in some ways ?

sorry I don’t understand what you say.
Could you be more precise ?

Was saying the ‘Plugin’ item in settings menu was giving a blank page on the web-ui. Nevermind, web-ui is down now and I can’t get it to work.
But the ‘volumio:3000/dev’ page does work.

Hi folks,

I managed to get UI working fine etc. But, still, despite I switched to dev branch, I can’t figure out how to enable my test plugin.
I modified app/plugins/plugins.json to add my plugin. I also used Spotify plugin conf to enable it in this file.

#app/plugins/plugins.json
{
  "music_service": {
    "gplay": {
      "enabled": {
        "type": "boolean",
        "value": true
      },
      "status": {
        "type": "string",
        "value": "STARTED"
      }
    }
...

and

#app/plugins/music_services/gplay/config.json
{
  "enabled": {
    "type": "boolean",
    "value": true
  }
...

volumio.log shows

info: Plugin gplay is not enabled

Any direction welcome

Peace.

If you use the dev branch and compiled the Ui, you don’t need to edit this files! Just create a zip file containing all needed files. As I said, have a look in plugin repo (gh pages)

volumio.github.io/docs/Plugin_S … rview.html

Woooo ! A new documentation ^^

Yeah, still unfinished but should be ok for you to get started. To reply your last question (sorry for the delay). You want to edit the /data/configuration/plugins.json
This is because we place all editable files in the data partition…

If you have problems feel free to write me here or on gitter!

Thank you for the docs. i managed to get lot further.

I’m a bit confused with the explodeUri function.

Now i can add items to browse sources but I can’t list retrieved playlists, I guess explodeUri has a role but can’t figure it out.

according to this handleBrowseUri function :

[code]GoogleMusic.prototype.handleBrowseUri=function(curUri) {
var self=this;

self.commandRouter.logger.info(curUri);
var response;

if (curUri.startsWith('googlemusic')) {
	if(curUri=='googlemusic')
	{
		response=libQ.resolve({
			navigation: {
				prev: {
					uri: 'googlemusic'
				},
				list: [
					{
						service: 'googlemusic',
						type: 'folder',
						title: 'My Playlists',
						artist: '',
						album: '',
						icon: 'fa fa-folder-open-o',
						uri: 'googlemusic/playlists'
					}
				]
			}
		});
	}
	else if(curUri == 'googlemusic/playlists')
	{
		response=self.listPlaylists(self.playlists)
		console.log('should find "Playlists"')
	}
	else if (curUri.startsWith('googlemusic/playlists')) 
	{
		response=self.listPlaylists(self.playlists)
		console.log('should find the all playlist items')
	}
}

return response;

}[/code]

listPlaylists returning

{
    "navigation": {
        "prev": {
          "uri": "googlemusic"
        },
        "list" : [
            {
                "service": "googlemusic",
                "type": "folder",
                "artist": "",
                "album": "",
                "icon": "fa fa-folder-open-o",
                "title" = "My name",
                "uri" = "googlemusic/playlist/my-unreadable-id-from-google-play"
            },
            {...}
        ]
    }
}

what should explodeUri look like ? I didn’t even manage to log in console from explodeUri (but that may be designed for) :confused:

Sorry… My fault, we changed the browse api last week, and I did not update the docs…

Give me one hour and I’ll do it…

I’ve updated the docs with new browse APIs.

For your convenience :

[code]

{
“navigation”: {
“prev”: {
“uri”: “googlemusic”
},
“lists” : [
title": “Goole Music Playlists”,
“icon”: “fa fa-folder-o”,
“availableListViews”: [“list”,“grid” ],
“items”: [
{
“service”: “googlemusic”,
“type”: “folder”,
“artist”: “”,
“album”: “”,
“icon”: “fa fa-folder-open-o”,
“title” = “My name”,
“uri” = “googlemusic/playlist/my-unreadable-id-from-google-play”
},
{…}
]
}
}[/code]

Let me know if you need further help. It may also help if you rebuild the UI or use a locally deployed version . This way you’ll have console.log via the inspector .

github.com/volumio/Volumio2-UI

See the gulp --serve part

Great , TU !