[mythtv-users] MythUtil interest?

Philip Brady Phil.Brady at hotmail.co.uk
Wed Aug 31 19:05:35 UTC 2016




________________________________
On 08/31/2016 09:05 AM, Philip Brady wrote:
>> At some point I will try to write up a couple of issues/limitations I
>> encountered with using the services API and send them to the
>> devs for consideration (and try to create patches if I can figure
>> how to address the issue(s)).
> Gary,
>
> if you are taking requests for fixes to API then these are hitting my channel editor:
>
> 1.  UpdateDBChannel  ignores attempt to set null values for XMLTVID
> https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmythtv/channelutil.cpp
> lines 1595 and 1628 thought to be the culprits.

>What do you mean by "ignores attempt to set null values"?  I think you
>mean to say it ignores attempts to clear the value stored in the field.
>The xmltvid field is:

>`xmltvid` varchar(255) NOT NULL DEFAULT ''

>so it definitely should /not/ allow it to be set to null.  Are you
>saying you're unable to clear its value--to set it to the empty string?
>If so, that will need to be fixed (and, likely, will require changes for
>a lot of other fields throughout the API).

> 2.  UpdateDBChannel  does not allow CommFree to be changed

>CommFree doesn't exist.  It's derived data--derived from the
>commmethod--"displayed" only for convenience of interpretation/ease of
>visibility.  When you set commmethod, you set commfree.

> 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>

>Therefore, you should not be allowed to set commfree--as allowing so
>would result in ambiguity when both commmethod and commfree are specified.

Mike
------------------
Mike.
> What do you mean by "ignores attempt to set null values"?  I think you
> mean to say it ignores attempts to clear the value stored in the field.
> [...]

Exactly - Sorry if I was not clear:
If you take a 'raw' database with no XMLTVID data in it, the GetChannelInfoList returns a blank field (no characters) for XMLTVID.
<XMLTVID></XMLTVID>
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.

> 2.  UpdateDBChannel  does not allow CommFree to be changed
> CommFree doesn't exist.  It's derived data--derived from the
> commmethod--"displayed" only for convenience of interpretation/ease of
> visibility.  When you set commmethod, you set commfree.

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'.
A simple boolean can therefore not reflect the settings needed in the database.
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!

Think I'd better do the latter.

Thanks for clarifying.
Phil

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20160831/cd0ef4dd/attachment.html>


More information about the mythtv-users mailing list