<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Nov 2, 2014 at 8:55 AM, Paul Harrison <span dir="ltr"><<a href="mailto:mythtv@sky.com" target="_blank">mythtv@sky.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">On 02/11/14 16:40, Mike Rice wrote:<div><div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
On Sat, Nov 1, 2014 at 6:47 PM, Mike Rice <<a href="mailto:mikerice1969@gmail.com" target="_blank">mikerice1969@gmail.com</a> <mailto:<a href="mailto:mikerice1969@gmail.com" target="_blank">mikerice1969@gmail.com</a><u></u>>> wrote:<br>
<br>
<br>
I believe I have it generally working by using urlencoded data and<br>
remapping the keys since as Bill mentioned they are different. To<br>
me this seems pretty dangerous. Much more dangerous than using<br>
mysql to set a single column.<br>
<br>
As far as I can tell you need to supply each parameter to the<br>
function:<br>
<br>
bool Channel::UpdateDBChannel( uint MplexID,<br>
uint SourceID,<br>
uint ChannelID,<br>
const QString &CallSign,<br>
const QString &ChannelName,<br>
const QString &ChannelNumber,<br>
uint ServiceID,<br>
uint ATSCMajorChannel,<br>
uint ATSCMinorChannel,<br>
bool UseEIT,<br>
bool visible,<br>
const QString &FrequencyID,<br>
const QString &Icon,<br>
const QString &Format,<br>
const QString &XMLTVID,<br>
const QString &DefaultAuthority )<br>
<br>
If you don't supply the parameter it ends up zero and your table<br>
is updated with a zero value for that column. If I am careful I<br>
can get this right now but if someone adds a parameter here and<br>
does not add it with the same name in the GET function (or if my<br>
script doesn't use those keys) it will be zero when I call the<br>
function.<br>
<br>
<br>
To answer my own question. The wsdl info describes all the parameters to the routine. So the script can build the parameter data by walking the wsdl parameters and then only issue to POST call when we have data for each parameter. This would solve my concern about unspecified fields getting zero values. It's also safer than relying only on the documentation.<br>
<br>
At some point when I get a better understanding of this stuff I will update the Wiki with some examples.<br>
<br>
</blockquote>
<br></div></div>
It sounds like UpdateDBChannel has been implemented incorrectly it's not meant to update a value which was not specified.<br>
<br>
Paul H.<div class=""><div class="h5"></div></div></blockquote></div><br></div><div class="gmail_extra">Are all the APIs that update implemented like this or is this just an anomaly? If it could just be called with <span style="font-family:arial,sans-serif;font-size:12.8000001907349px">ChannelID=1005&visible=false that sure would make simpler and safer to use. </span></div><div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:12.8000001907349px"><br></span></div><div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:12.8000001907349px">Anyway as it turns out writing a simple sql command was so easy I never really gave this 'visible' problem much thought. After spending time trying to write a script for it I've come to the conclusion that I don't really even want this script anymore. I think I can do better just adjusting my recording rules.</span></div><div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:12.8000001907349px"><br></span></div><div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:12.8000001907349px">Currently I have rules that:</span></div><div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:12.8000001907349px">1. Record my favorite hockey team on any channel</span></div><div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:12.8000001907349px">2. Record my favorite baseball team on any channel</span></div><div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:12.8000001907349px"><br></span></div><div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:12.8000001907349px">There are a set of channels GAME* that require an extra subscription and I typically only buy the hockey version. To avoid trying to record baseball from those channels I would change the visible field.</span></div><div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:12.8000001907349px"><br></span></div><div class="gmail_extra"><font face="arial, sans-serif">I now realize a better solution would be to change rules 1 and 2 so they do not record on the GAME channels. Then add a third rule that only records on the GAME channels. With this I can easily (without a script) deactivate the rule when I do not have the subscription and reactivate it when I do (or when there is a free preview happening). This should be much better for me.</font></div><div class="gmail_extra"><font face="arial, sans-serif"><br></font></div><div class="gmail_extra"><font face="arial, sans-serif">The next script I looked at appears to have the same issue. I record all 'New Movies" from a set of premium channels. Then daily use a script to change the Recording Group to "Movies-Best, Movies-Better, Movies-Subtitled, etc." based on the "stars" rating. Instead I really should just set up separate rules for each and then they would automatically go to the correct group. With rules I can also modify the priorities of each rule so "Movies-Best" would be recorded before "Movies-Good" and "Movies-Bad" would be expired before "Movies-Best". </font></div><div class="gmail_extra"><font face="arial, sans-serif"><br></font></div><div class="gmail_extra"><font face="arial, sans-serif">I don't know if this is true for all my scripts but thought I'd bring it up here. Turns out that because I could write a sql query easily I've been doing stuff sub-optimally for years. </font></div><div class="gmail_extra"><font face="arial, sans-serif"><br></font></div><div class="gmail_extra"><font face="arial, sans-serif">I am still going to purse learning how to use these APIs but by the time I am done reviewing my scripts I might not actually need to use them.</font></div></div>