A work around for selecting seasons. While this is achievable with the current commands, this work around lets you call a season without saying the full phrase again.
Step 1:We will need a python file with this code: (Notepad++ works well)
def tvseason(com = dict):
if com.has_key("Container.FolderPath"):
return com.get("Container.FolderPath")
Save this file as
seasoncall.py in the
PY folder in your VoXCommando directory. (remember the
.py on the end.
Step2:Then use this command to load the python file at startup:
<command id="1436" name="load python startup code" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>PY.ExecFile</cmdType>
<cmdString>PY\seasoncall.py</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>load python startup code, load python startup script</phrase>
<event>python ready</event>
</command>
Change seasoncall.py to what ever your python script is called, but once again remember the
.py on the end.
The basics of the script is turn the JSON query into a dictionary (fortunately JSON return format from query's is already set as python dictionary. Then if the key is present in the query return the value for the key.
Step3:You'll then need the commands to run the script:
<command id="1501" name="Season Call" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>XJson.Raw</cmdType>
<cmdString>XBMC.GetInfoLabels&&"labels" : ["Container.FolderPath"]</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>PY.ExecString</cmdType>
<cmdString>result=tvfilter({LastResult})</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>XJson.Raw</cmdType>
<cmdString>GUI.ActivateWindow&&"window": "video", "parameters": [ "{LastResult}{1}/" ]</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>show me season</phrase>
<payloadRange>1,10</payloadRange>
</command>
Should look like this:
Keep in mind you must be looking at the season window for a tvshow in XBMC for this to work.
Something like this:
While this is a messy work around is does give everyone a bit of an idea what is possible with the python plugin.
The python script can be adjusted for pretty much any JSON query which is cool.
Script attached at the bottom. Feel free to download and copy to the
PY folder.