Author Topic: Kodi/Google Music plugin Integration.  (Read 8340 times)

0 Members and 1 Guest are viewing this topic.

wannaspeed

  • Jr. Member
  • **
  • Posts: 17
  • Karma: 1
    • View Profile
Re: Kodi/Google Music plugin Integration.
« Reply #15 on: December 10, 2016, 08:53:46 PM »
Here's a bonus command, "Play Google Thumbs Up". This plays the list of songs that you've previously thumbed up in Google Music. Basically a favourites playlist.
Thanks for helping with this! Sure enough that fixed it when I add it to my voicecommands.xml. For some reason when I try to build these in the logical command builder the syntax gets changed all around. I'll use the google thumbs up playlist as an example. I enter my action into the first box as XJson.Raw then the next box is Player.Open, the 3rd box for the parameters I copy and paste:

Code: [Select]
"item":{"file":"plugin://plugin.audio.googlemusic.exp/?action=play_all&playlist_id=thumbsup&shuffle=true"}
Save and execute results in an error so I open the voicecommands.xml and it looks like this:

Code: [Select]
<phrase>Launch Google Music</phrase>
            </command>
            <command id="545" name="Play Google Thumbs Up" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="&quot;item&quot;:{&quot;file&quot;:&quot;plugin://plugin.audio.googlemusic.exp/?action=play_all&amp;amp;playlist_id=thumbsup&amp;amp;shuffle=true&quot;}&#xD;&#xA;&#xD;&#xA;&quot;item&quot;:{&quot;file&quot;:&quot;plugin://plugin.audio.googlemusic.exp/?action=play_all&amp;amp;playlist_id=thumbsup&amp;amp;shuffle=true&quot;}">
                <action>
                    <cmdType>XJson.Raw</cmdType>
                    <params>
                        <param>Player.Open</param>
                        <param>"item":{"file":"plugin://plugin.audio.googlemusic.exp/?action=play_all&amp;amp;playlist_id=thumbsup&amp;amp;shuffle=true"}</param>
                    </params>
                    <cmdRepeat>1</cmdRepeat>
                </action>
                <phrase>Play Google Thumbs Up</phrase>
            </command>

I don't know what's going on there but it doesn't look like what I put in the parameter field, the word amp is put in there multiple times for one. But if I copy/Paste directly to the XML it works fine. What gives?

Quote
The trick to figuring out the syntax for all this stuff is to manually play (or queue or navigate to) Google Music media in Kodi, and then check Kodi's log to find the query that is used.

Do you mind elaborating on this? For instance how do I take what I see in the log and convert it to a command that vox properly sends to kodi? Here's a log as I open google music and navigate to my thumbs up playlist and play a song with shuffle
Code: [Select]
18:39:16 T:8596  NOTICE: [GoogleMusicEXP-1.10.6] Getting playlists of type: auto
18:39:24 T:4488  NOTICE: [GoogleMusicEXP-1.10.6]  ARGV: ['plugin://plugin.audio.googlemusic.exp/', '-1', '?action=play_all&playlist_id=thumbsup&shuffle=true']
18:39:24 T:4488  NOTICE: [GoogleMusicEXP-1.10.6] Loading playlist: thumbsup

So I think I need to take
Code: [Select]
['plugin://plugin.audio.googlemusic.exp/', '-1', '?action=play_all&playlist_id=thumbsup&shuffle=true']

So if I was building it in the logical command block, which may or may not be working correctly for me, I would have something like...
 
XJson.Raw   
Player.Open
      "item":{"file":"plugin://plugin.audio.googlemusic.exp/',-1,'?action=play_all&playlist_id=thumbsup&shuffle=true"}

wannaspeed

  • Jr. Member
  • **
  • Posts: 17
  • Karma: 1
    • View Profile
Re: Kodi/Google Music plugin Integration.
« Reply #16 on: December 10, 2016, 08:58:29 PM »
ok after i poster i looked up amp in XML and found that it stands for &. so by me copy/paste into the builder its like putting it twice. Going to fix that and test it.

EDIT: Apparently there must be more lost/changed between the XML and the builder. If I want to use the builder how would I convert either a kodi log into the proper syntax or convert an XML into the proper syntax for the builder?

edit edit: Well i discovered you can just drag XML into the tree that's definitely helpful.
« Last Edit: December 10, 2016, 11:24:36 PM by wannaspeed »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Kodi/Google Music plugin Integration.
« Reply #17 on: December 11, 2016, 08:40:08 AM »
I don't recommend you try to edit anything directly in XML.  Always use the command builder.  XML encodes certain characters such as '&'.  That's just how it works.

To see the correct format just look at nime5ter's command in the builder after pasting it into your tree.

So for example the correct parameter to use for playing favourites using "player.open" is the following:
Code: [Select]
"item":{"file":"plugin://plugin.audio.googlemusic.exp/?action=play_all&playlist_id=thumbsup&shuffle=true"}

wannaspeed

  • Jr. Member
  • **
  • Posts: 17
  • Karma: 1
    • View Profile
Re: Kodi/Google Music plugin Integration.
« Reply #18 on: December 11, 2016, 09:01:19 PM »
I don't recommend you try to edit anything directly in XML.  Always use the command builder.  XML encodes certain characters such as '&'.  That's just how it works.

To see the correct format just look at nime5ter's command in the builder after pasting it into your tree.

So for example the correct parameter to use for playing favourites using "player.open" is the following:
Code: [Select]
"item":{"file":"plugin://plugin.audio.googlemusic.exp/?action=play_all&playlist_id=thumbsup&shuffle=true"}

Yeah I didn't initially realize you could drag and drop onto the tree, that's a very nice feature. Makes things much easier. Is it recommended to use another program for testing the syntax of commands to Kodi? Or just build and execute from the command tree?