1
VoxCommando Basics and Core Features / Question in regards to optional payloads
« on: August 01, 2016, 06:09:11 PM »
Hello guys,
So I'm using a program called MoviePosterApp, not sure if anyones heard of it but it basically runs through movie posters in your library or from TheMovieDB to show upcoming movies. www.movieposterapp.com if you want to check it out.
Anyway it uses basic http commands so I've gone ahead and have actually made a few different options for displaying different movie posters by name using voxcommando. I"ll have a video of me doing this soon. However I've come across a tricky one that I'm a little stumped on and looking for some ideas on how to make this work. Here is my current command that I've created.
I tried a few different ways of just passing the payload directly over in the command but the information wasn't passing along. I've found that if I structure it this way I can get it to post almost 100% correct. Except when you don't use the option variables it tries to send stuff along that makes it break a bit. Is there a way that if the variable isn't used that it just skips it? Let me know if I am not explaining this correctly.
So I'm using a program called MoviePosterApp, not sure if anyones heard of it but it basically runs through movie posters in your library or from TheMovieDB to show upcoming movies. www.movieposterapp.com if you want to check it out.
Anyway it uses basic http commands so I've gone ahead and have actually made a few different options for displaying different movie posters by name using voxcommando. I"ll have a video of me doing this soon. However I've come across a tricky one that I'm a little stumped on and looking for some ideas on how to make this work. Here is my current command that I've created.
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.2.0-->
<commandGroup open="True" name="Show Times" enabled="True" prefix="" priority="0" requiredProcess="" description="">
<command id="132" name="Add Showtime" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<if ifBlockDisabled="False" ifNot="True">
<ifType>(A)<(B)</ifType>
<ifParams>{5}&&</ifParams>
<then>
<action>
<cmdType>Results.SetVar</cmdType>
<params>
<param>op1</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
</then>
<else>
<action>
<cmdType>Results.SetVar</cmdType>
<params>
<param>op1</param>
<param>{5}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
</else>
</if>
<if ifBlockDisabled="False" ifNot="True">
<ifType>(A)<(B)</ifType>
<ifParams>{6}&&</ifParams>
<then>
<action>
<cmdType>Results.SetVar</cmdType>
<params>
<param>op2</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
</then>
<else>
<action>
<cmdType>Results.SetVar</cmdType>
<params>
<param>op2</param>
<param>{6}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
</else>
</if>
<action>
<cmdType>Scrape</cmdType>
<params>
<param>http://captainamerica:8082/showtimes.html?addShowtime({1},{2}%20{3}%20{4}%20{var.op1}%20{var.op2})</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>add poster showtime</phrase>
<phrase optional="true">for</phrase>
<payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">XbmcPayloads\xbmcIMDB.xml</payloadFromXML>
<payloadList>Tonight,Tomorrow,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday</payloadList>
<payloadList optional="true">at</payloadList>
<payloadRange>1,24</payloadRange>
<payloadList optional="true">:15,:30,:45</payloadList>
<payloadList>AM,PM</payloadList>
</command>
</commandGroup>
I tried a few different ways of just passing the payload directly over in the command but the information wasn't passing along. I've found that if I structure it this way I can get it to post almost 100% correct. Except when you don't use the option variables it tries to send stuff along that makes it break a bit. Is there a way that if the variable isn't used that it just skips it? Let me know if I am not explaining this correctly.