<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p><br>
</p>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<div>
<hr tabindex="-1" style="display:inline-block; width:98%">
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">On 08/31/2016 09:05 AM, Philip Brady wrote:<br>
>> At some point I will try to write up a couple of issues/limitations I<br>
>> encountered with using the services API and send them to the<br>
>> devs for consideration (and try to create patches if I can figure<br>
>> how to address the issue(s)).<br>
> Gary,<br>
><br>
> if you are taking requests for fixes to API then these are hitting my channel editor:<br>
><br>
> 1.  UpdateDBChannel  ignores attempt to set null values for XMLTVID<br>
> <a href="https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmythtv/channelutil.cpp">
https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmythtv/channelutil.cpp</a><br>
> lines 1595 and 1628 thought to be the culprits.<br>
<br>
>What do you mean by "ignores attempt to set null values"?  I think you <br>
>mean to say it ignores attempts to clear the value stored in the field.  <br>
>The xmltvid field is:<br>
<br>
>`xmltvid` varchar(255) NOT NULL DEFAULT ''<br>
<br>
>so it definitely should /not/ allow it to be set to null.  Are you <br>
>saying you're unable to clear its value--to set it to the empty string?  <br>
>If so, that will need to be fixed (and, likely, will require changes for <br>
>a lot of other fields throughout the API).<br>
<br>
> 2.  UpdateDBChannel  does not allow CommFree to be changed<br>
<br>
>CommFree doesn't exist.  It's derived data--derived from the <br>
>commmethod--"displayed" only for convenience of interpretation/ease of <br>
>visibility.  When you set commmethod, you set commfree.<br>
<br>
<a href="https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmyth/programtypes.h#L93">> https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmyth/programtypes.h#L93</a><br>
<br>
>Therefore, you should not be allowed to set commfree--as allowing so <br>
>would result in ambiguity when both commmethod and commfree are specified.<br>
<br>
Mike<br>
------------------<br>
<div>Mike.<br>
> What do you mean by "ignores attempt to set null values"?  I think you<br>
> mean to say it ignores attempts to clear the value stored in the field. <br>
> [...]<br>
<br>
Exactly - Sorry if I was not clear:<br>
If you take a 'raw' database with no XMLTVID data in it, the GetChannelInfoList returns a blank field (no characters) for XMLTVID.<br>
<XMLTVID></XMLTVID><br>
If you then set a real value then you are unable to subsequently reset it to blank (ie a zero length string) again with UpdateDBChannel.  Any attempts are simply ignored but you can set it to (say) a single space.  <br>
<br>
> 2.  UpdateDBChannel  does not allow CommFree to be changed<br>
> CommFree doesn't exist.  It's derived data--derived from the<br>
> commmethod--"displayed" only for convenience of interpretation/ease of<br>
> visibility.  When you set commmethod, you set commfree.<br>
<br>
Yes, I see now that it's my misunderstanding.  From a user viewpoint the backend setup allows various types of comm flagging, only one of which is 'no flagging'.<br>
A simple boolean can therefore not reflect the settings needed in the database.<br>
So, either the API interface needs a big enhancement to show and set the actual value and that's not justified because commflagging is probably still subject to tweaking and new methods, or I need to rip some code out of the perl based channel editor!<br>
<br>
Think I'd better do the latter.<br>
<br>
Thanks for clarifying.<br>
Phil<br>
</div>
<br>
</div>
</span></font></div>
</div>
</body>
</html>