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

0 Members and 1 Guest are viewing this topic.

DexDeadly

  • Jr. Member
  • **
  • Posts: 27
  • Karma: 3
    • View Profile
Kodi/Google Music plugin Integration.
« on: June 17, 2016, 03:34:33 PM »
Hello Everyone,
**I want to preface this with thanking JitterJames for helping simplify this integration without the need for modifying the plugin like I originally thought**

Just thought I'd post up what I had been working on the past couple days.  I've been a huge user of google music and most recently using it within Kodi.  You can find the plugin for Kodi here:

http://forum.kodi.tv/showthread.php?tid=200640

While installing and setting up the plugin I noticed it had a local db called googlemusic.db .  Knowing that within the xSql plugin we can generate payloads using these database files an idea was born. 

Here is the SQL queries used to generate the 4 payload files needed. 

Custom   select playlist_id, name from playlists                                                    gmusicplaylist   False
Custom   select distinct album from songs                                                            gmusicalbum   True
Custom   select ('song_id='||song_id||'&artistart='||artistart), title from songs    gmusicsong   False
Custom   select distinct artist from songs                                                                    gmusicartist   True

The artist and album payloads are phrase only files while the other 2 are value / phrase.

If you are using the custom db field on the plugin update to the latest VoxCommando just recently uploaded by JitterJames which includes fixes to the xSql plugin. 

Once you generate your payloads here is the 4 commands to use.  Thanks to JitterJames again for making these a little more smooth.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.2.0-->
<commandGroup open="True" name="Kodi GMusic" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="434" name="Play Google Playlist {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>XJson.Raw</cmdType>
      <params>
        <param>Player.Open</param>
        <param>"item":{"file":"plugin://plugin.audio.googlemusic.exp/?action=play_all&amp;playlist_id={1}&amp;shuffle=true"}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase optional="true">play</phrase>
    <phrase>google playlist</phrase>
    <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">XbmcPayloads\gmusicplaylist.xml</payloadFromXML>
  </command>
  <command id="417" name="Play Google Artist {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>XJson.Raw</cmdType>
      <params>
        <param>Player.Open</param>
        <param>"item":{"file":"plugin://plugin.audio.googlemusic.exp/?action=play_all&amp;filter_type=artist&amp;filter_criteria={1}&amp;shuffle=true"}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase optional="true">play</phrase>
    <phrase>google artist</phrase>
    <payloadFromXML phraseOnly="True" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">XbmcPayloads\gmusicartist.xml</payloadFromXML>
  </command>
  <command id="407" name="Play Google Album {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>XJson.Raw</cmdType>
      <params>
        <param>Player.Open</param>
        <param>"item":{"file":"plugin://plugin.audio.googlemusic.exp/?action=play_all&amp;filter_type=album&amp;filter_criteria={1}"}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase optional="true">play</phrase>
    <phrase>google album</phrase>
    <payloadFromXML phraseOnly="True" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">XbmcPayloads\gmusicalbum.xml</payloadFromXML>
  </command>
  <command id="423" name="Play Google Song {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>XJson.Raw</cmdType>
      <params>
        <param>Player.Open</param>
        <param>"item":{"file":"plugin://plugin.audio.googlemusic.exp/?action=play_song&amp;{1}"}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase optional="true">play</phrase>
    <phrase>google</phrase>
    <phrase>song, track</phrase>
    <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">XbmcPayloads\gmusicsong.xml</payloadFromXML>
  </command>
</commandGroup>

Here is a video demonstration of how it is working. 



Feel free to ask any questions!
« Last Edit: June 17, 2016, 08:25:57 PM by DexDeadly »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Kodi/Google Music plugin Integration.
« Reply #1 on: June 17, 2016, 06:10:20 PM »
Great stuff Dex!  ::wiggle

For what it's worth, I don't think you need to modify the Kodi addon in order to get the album and artist names, and going forward the best solution will be one that does not require changes to the addon.  If changes are actually required in the addon then we should try to ask the developer of the addon to make the changes official.  Otherwise it's harder for new users to get started using it and also there will be problems any time the official addon gets an update.

I'll post my suggestion on how to get the data once I have a chance to test my theory.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Kodi/Google Music plugin Integration.
« Reply #2 on: June 17, 2016, 06:22:43 PM »
I noticed some minor inconsistencies.  The names you give your files in your sql do not all match the filenames used in your command xml.  Some are plural (e.g. artists) and some a singular (artist).  Probably best to use singular for all to avoid problems.

DexDeadly

  • Jr. Member
  • **
  • Posts: 27
  • Karma: 3
    • View Profile
Re: Kodi/Google Music plugin Integration.
« Reply #3 on: June 17, 2016, 06:38:42 PM »
Hey JitterJames,

Thanks for the compliments! It's fun

Thats my fault, I typed out the filenames and I'll go ahead and fix the original post.  Thanks for catching that.  I've posted to the plugin thread showing this.  I wonder if he would be willing to add the information to the local database that is created and update the GoogleMusicStorage.py .  I could possibly submit this to his github. 

I'd be curious if you find that out.  I think you can sync it to the local library.  I didn't play much with it but if you find something let me know.  I just know when I looked it was always pointing to its own database.  Any other tips you have for this stuff I'd be glad to hear it!  I have another integration I'm working on completing with a program called MoviePosterApp :).

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Kodi/Google Music plugin Integration.
« Reply #4 on: June 17, 2016, 07:00:36 PM »
I'd be curious if you find that out.  I think you can sync it to the local library.  I didn't play much with it but if you find something let me know.  I just know when I looked it was always pointing to its own database.

I'm sorry, I'm not sure what you are talking about here.

Here are the SQL settings that work for me using the original unmodified Google Music Addon. (see image below).

Here is SQL for copy and pasting:

Customselect playlist_id, name from playlistsgmusicplaylistFalse
Customselect distinct album from songsgmusicalbumTrue
Customselect ('song_id='||song_id||'&amp;artistart='||artistart), title from songsgmusicsongFalse
Customselect distinct artist from songsgmusicartistTrue

I'm using "phrase only" payload XML files for artist and album since there is no ID, which means there is no value column required in the payloadXML.

Here's the xml for the commands after my modifications.
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.2.0-->
<commandGroup open="True" name="Kodi GMusic" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="434" name="Play Google Playlist {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>XJson.Raw</cmdType>
      <params>
        <param>Player.Open</param>
        <param>"item":{"file":"plugin://plugin.audio.googlemusic.exp/?action=play_all&amp;playlist_id={1}&amp;shuffle=true"}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase optional="true">play</phrase>
    <phrase>google playlist</phrase>
    <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">XbmcPayloads\gmusicplaylist.xml</payloadFromXML>
  </command>
  <command id="417" name="Play Google Artist {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>XJson.Raw</cmdType>
      <params>
        <param>Player.Open</param>
        <param>"item":{"file":"plugin://plugin.audio.googlemusic.exp/?action=play_all&amp;filter_type=artist&amp;filter_criteria={1}&amp;shuffle=true"}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase optional="true">play</phrase>
    <phrase>google artist</phrase>
    <payloadFromXML phraseOnly="True" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">XbmcPayloads\gmusicartist.xml</payloadFromXML>
  </command>
  <command id="407" name="Play Google Album {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>XJson.Raw</cmdType>
      <params>
        <param>Player.Open</param>
        <param>"item":{"file":"plugin://plugin.audio.googlemusic.exp/?action=play_all&amp;filter_type=album&amp;filter_criteria={1}"}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase optional="true">play</phrase>
    <phrase>google album</phrase>
    <payloadFromXML phraseOnly="True" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">XbmcPayloads\gmusicalbum.xml</payloadFromXML>
  </command>
  <command id="423" name="Play Google Song {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>XJson.Raw</cmdType>
      <params>
        <param>Player.Open</param>
        <param>"item":{"file":"plugin://plugin.audio.googlemusic.exp/?action=play_song&amp;{1}"}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase optional="true">play</phrase>
    <phrase>google</phrase>
    <phrase>song, track</phrase>
    <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">XbmcPayloads\gmusicsong.xml</payloadFromXML>
  </command>
</commandGroup>

I massaged the phrases a little bit.

I didn't change anything in your macros.  I'm glad you figured all that stuff out!

I changed the names of the commands for 2 reasons.  1 is to make it easier to know how to say the command when looking at the command name.  The other is that putting {1} in the command name will make the command show better alternates in the OSD so you can see the payload phrase.  It's totally optional but handy.

I noticed there is still a bug in the plugin with options.  The path to the custom database is not being saved properly.  Watch out for that and I'll add this fix to the new version I just uploaded.

Edit: I've uploaded a new version 2.2.2.0 just a minute ago.
« Last Edit: June 17, 2016, 07:17:43 PM by jitterjames »

DexDeadly

  • Jr. Member
  • **
  • Posts: 27
  • Karma: 3
    • View Profile
Re: Kodi/Google Music plugin Integration.
« Reply #5 on: June 17, 2016, 08:14:32 PM »
My mistake, I thought you meant using the kodi music db which is the Music**.db file.

I see how you have simplified it. I appreciate that. Once I started digging into it originally the way I saw the data being used was with IDs which were not included so I needed to modify the file, once I figured out how to do it without the ID I didn't think to go back and change it.  I was happy it worked and wanted to share :).  This is much more simplified and as you mentioned now requiring no need for modifications.  Seems I need to make an updated video.  I actually had been tweaking the phrases myself and came up with the same thing you did actually.  I originally tried to do phrase only but I must of done something wrong because it did not work.  I've updated that now and see it working. 

I never knew why the {1} was in the name but thanks for that little tidbit.  That is definitely a helpful piece of information.  I'm downloading the latest version of voxcommando now and installing it.  Thanks again for the help.  I've put your simplified info in the original post :)
« Last Edit: June 17, 2016, 08:18:34 PM by DexDeadly »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Kodi/Google Music plugin Integration.
« Reply #6 on: June 17, 2016, 09:21:41 PM »
@DexDeadly -- This is a great addition to the Kodi/VC package. Thanks for posting a full explanation and video demo along with your command xml.

Always nice to see some new, helpful videos out there. :)

By the way, in case you have not yet discovered this -- when using VoxWav, if the app shows that it has recognized the correct command but the confidence is too low for it to execute automatically, you can tap on the command on your Android screen to execute that command. I find that a major benefit of using the app relative to a standard mic. This is true whether it shows the command as yellow (below the confidence level that you've set) or even red (so low that the speech engine does not think it understood the command).
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

DexDeadly

  • Jr. Member
  • **
  • Posts: 27
  • Karma: 3
    • View Profile
Re: Kodi/Google Music plugin Integration.
« Reply #7 on: June 17, 2016, 09:35:26 PM »
Thanks @nime5ster

Yea, ever since I've gotten this installed and Ragnarok over at Cinemavision purchased this for me and I've purchased the beam I've been in integration heaven haha.  I have a few more things I'm working on and plan on doing the same with the writeup and video. 

I was unaware that I could hit that.  That will make doing these videos a lot easier if it gives me yellow so I don't have to keep trying :). I don't get that very often but my luck it happened as I was recording haha. 

Anyway, thanks for the kind words and more to come!

wannaspeed

  • Jr. Member
  • **
  • Posts: 17
  • Karma: 1
    • View Profile
Re: Kodi/Google Music plugin Integration.
« Reply #8 on: December 07, 2016, 06:08:52 PM »
I don't know if anyone still uses this command tree, but I just installed Vox yesterday and added it. Has worked great, except it seems "Play google artist or Play google album" doesn't work. Vox recognizes the command and passes it to Kodi, but the plugin returns an error. This is the error reported by Kodi.

Code: [Select]
15:57:33 T:12032   ERROR: Previous line repeats 9 times.
15:57:33 T:12032  NOTICE: [GoogleMusicEXP-1.10.6]  ARGV: ['plugin://plugin.audio.googlemusic.exp/', '49', '?action=play_all&filter_type=artist&filter_criteria=Five Finger Death Punch&shuffle=true']
15:57:34 T:12032   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.AttributeError'>
                                            Error Contents: 'NoneType' object has no attribute 'replace'
                                            Traceback (most recent call last):
                                              File "C:\Users\mrvog\AppData\Roaming\Kodi\addons\plugin.audio.googlemusic.exp\default.py", line 35, in <module>
                                                GoogleMusicActions.GoogleMusicActions().executeAction(action, params)
                                              File "C:\Users\mrvog\AppData\Roaming\Kodi\addons\plugin.audio.googlemusic.exp\GoogleMusicActions.py", line 12, in executeAction
                                                utils.playAll(self._getSongs(params), 'shuffle' in params)
                                              File "C:\Users\mrvog\AppData\Roaming\Kodi\addons\plugin.audio.googlemusic.exp\GoogleMusicActions.py", line 254, in _getSongs
                                                songs = self.api.getFilterSongs(get('filter_type'), urllib.unquote_plus(get('filter_criteria')), urllib.unquote_plus(get('artist')))
                                              File "C:\Program Files (x86)\Kodi\system\python\Lib\urllib.py", line 1240, in unquote_plus
                                                s = s.replace('+', ' ')
                                            AttributeError: 'NoneType' object has no attribute 'replace'
                                            -->End of Python script error report<--

Also I was wondering If I just want to launch the plugin what would the action look like? I tried XJson.Raw    Player.Open      "item":{"file":"plugin://plugin.audio.googlemusic.exp/"} and different varieties of that but couldn't figure it out. I tried with another kodi plugin and gave up. Instead I made keypress x launch the shortcut, not ideal and I know there has to be a better way. Thanks

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Kodi/Google Music plugin Integration.
« Reply #9 on: December 07, 2016, 07:19:33 PM »
Welcome to the forum.

Also I was wondering If I just want to launch the plugin what would the action look like? I tried XJson.Raw    Player.Open      "item":{"file":"plugin://plugin.audio.googlemusic.exp/"} and different varieties of that but couldn't figure it out. I tried with another kodi plugin and gave up. Instead I made keypress x launch the shortcut, not ideal and I know there has to be a better way. Thanks

You can try a solution similar to the one used for the youtube plugin in Kodi, which is included in the default config. However, since it's a Music addon, not a Videos addon, you'd change the "video" window to "music".

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.2.6-->
<command id="438" name="open google music screen in kodi" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>GUI.ActivateWindow</param>
      <param>"window": "music", "parameters": ["plugin://plugin.audio.googlemusic.exp/" ]</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>open google music screen in kodi</phrase>
</command>

I don't use Google Music so I can't help with the rest at the moment. I may test this out tonight though. What the heck.
« Last Edit: December 07, 2016, 07:28:56 PM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

wannaspeed

  • Jr. Member
  • **
  • Posts: 17
  • Karma: 1
    • View Profile
Re: Kodi/Google Music plugin Integration.
« Reply #10 on: December 07, 2016, 08:12:24 PM »
Welcome to the forum.

You can try a solution similar to the one used for the youtube plugin in Kodi, which is included in the default config. However, since it's a Music addon, not a Videos addon, you'd change the "video" window to "music".

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.2.6-->
<command id="438" name="open google music screen in kodi" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>GUI.ActivateWindow</param>
      <param>"window": "music", "parameters": ["plugin://plugin.audio.googlemusic.exp/" ]</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>open google music screen in kodi</phrase>
</command>

I don't use Google Music so I can't help with the rest at the moment. I may test this out tonight though. What the heck.

Thanks! Worked perfect! Now that I know the correct parameters I can do this for any other addons. Appreciate it!

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Kodi/Google Music plugin Integration.
« Reply #11 on: December 08, 2016, 02:14:05 PM »
I don't know if anyone still uses this command tree, but I just installed Vox yesterday and added it. Has worked great, except it seems "Play google artist or Play google album" doesn't work. Vox recognizes the command and passes it to Kodi, but the plugin returns an error.

Looks like maybe the query syntax for the addon has changed slightly. Here's a fix for the 'Play Artist':

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.2.6-->
<command id="428" name="Play Google Artist {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Player.Open</param>
      <param>"item":{"file":"plugin://plugin.audio.googlemusic.exp/', '-1', '?action=play_all&amp;filter_type=artist&amp;filter_criteria={1}&amp;shuffle=true&amp;artist="}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase optional="true">play</phrase>
  <phrase>google artist</phrase>
  <payloadFromXML phraseOnly="True" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">XbmcPayloads\gmusicartist.xml</payloadFromXML>
</command>

I will try to get to the 'Play Album' a bit later today when I have time. I think we may have to change the payload XML file to handle that one.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Kodi/Google Music plugin Integration.
« Reply #12 on: December 08, 2016, 03:55:06 PM »
To fix the Play Google Album command will require a few steps.

1. Replace the command with this:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.2.6-->
<command id="467" name="Play Google Album {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Player.Open</param>
      <param>"item":{"file":"plugin://plugin.audio.googlemusic.exp/?action=play_all&amp;filter_type=album&amp;filter_criteria={PF.1}&amp;artist={1}"}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase optional="true">play</phrase>
  <phrase>Google album</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">XbmcPayloads\gmusicalbum.xml</payloadFromXML>
</command>

2. Replace the sql query for the gmusicalbum payload XML in the Xsql plugin with the following query:
Code: [Select]
select distinct album_artist, album  from songs where album NOT LIKE '%???%'
The important change in this SQL query is that previously we were using a phrase-only payload XML file, which contained just the album name. It seems that now the addon requires both album name and the album artist, so in this query we are retrieving distinct album names as payload phrases and the artist associated with that album name becomes our payload value.

(I added the "NOT LIKE" just because I have a bunch of artists not associated with real album names in Google Music, apparently, and this is what the nullish values look like in the database. I prefer my payload xml to be clean and not contain a bunch of "???" phrases.)

If you look at the revised command, you'll see that I am using filter_criteria={PF.1} (the album title, which is our "friendly payload") and artist={1} (the associated payload value).

3. Regenerate your payload xml.

4. *Important*: Now open your command tree editor, go to this command in the tree and double click on the payload xml (i.e., "XbmcPayloads\gmusicalbum.xml") to open up the properties window for the payload XML file.

In that window, make sure the "Return values as payloads?" is set to "Phrase/Value".

Then save and exit the command tree to rebuild, and give it a whirl.

« Last Edit: December 11, 2016, 03:44:09 PM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Kodi/Google Music plugin Integration.
« Reply #13 on: December 08, 2016, 07:59:35 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.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.2.6-->
<command id="477" name="Play Google Thumbs Up" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Player.Open</param>
      <param>"item":{"file":"plugin://plugin.audio.googlemusic.exp/?action=play_all&amp;playlist_id=thumbsup&amp;shuffle=true"}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Play Google Thumbs Up</phrase>
</command>

Unlike the playlists you've created yourself, it does not exist in the addon's database and so it's not part of the playlist payload xml that we generate. Rather than a numerical ID, its ID is just "thumbsup". Other than that, it's exactly the same as the existing playlist command that we're already using.

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.

TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

DexDeadly

  • Jr. Member
  • **
  • Posts: 27
  • Karma: 3
    • View Profile
Re: Kodi/Google Music plugin Integration.
« Reply #14 on: December 09, 2016, 07:55:35 PM »
I must not of updated my plugin, I thought I was up to date as mine still works.  I like the new thumbs up command.  That is cool.  Glad you were able to get this figured out.