[mythtv] Services API for ChannelServices / Video Source

David Engel david at istwok.net
Fri Nov 1 19:57:46 UTC 2019


On Fri, Nov 01, 2019 at 04:06:55PM +0000, Gary Buhrmaster wrote:
> On Fri, Nov 1, 2019 at 2:49 PM David Engel <david at istwok.net> wrote:
> >
> > On Fri, Nov 01, 2019 at 08:54:18AM +0000, Stuart Morgan wrote:
> 
> > > The services API was intended to retain backwards compatibility at all times,
> 
> Thanks for confirming backwards compatibility is the
> intended goal.  My concern was that it appeared
> that in this case (based on the words in the email;
> I have not personally tested) that this was not
> properly implemented in this case, with new
> (required) parameters which would (especially in
> the case of updates) reset values not provided
> by existing callers.  If my understanding in not
> correct, my apologies.
> 
> > Also, another failing of the current API is the inability to pass an
> > "unspecified" indication to the endpoint.
> 
> I keep running into this one and the one where providing
> a JSON None does not result in a DB NULL value (where
> the value NULL is dealt with differently in the code base
> (than something like a 0 or empty string) so one must get
> a NULL in there, but at least in the cases I care about,
> there was no way to do so).
> 
> As for backward compatibility, for the Update methods,
> (I don't know how easy it is to implement), I would
> prefer that one should only update the provided values,
> not a complete row replacement (could be done by very
> selective DB updates of the provided entities, or
> retrieving the existing values, merging the provided
> input, and then doing the update).  I have had to jump
> through some hoops to do the equivalent (and even
> have a couple of cases of version specific checks for
> what to do and how to do it for some changes in the
> services API for some more obscure use cases).

<brainfart hopefulesomewilltrythis="true">

I wonder if the core services code could be coerced, or bludgeoned,
into doing a fule read/update/write.  For example, when UpdateFoo() is
called, first call GetFoo() to get the "template" for this update,
update the template with the new valuses that are present and then
sanity check and save the merged result if valid.

One like problem with this would be the inconsisten input/output
naming you mentioned in another email.  Fixing that could go hand in
hand with this.

</brainfart>

David

> 
> Anyway, thanks for accepting the input (even though
> it appears I have opened the can of worms).
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-dev
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org

-- 
David Engel
david at istwok.net


More information about the mythtv-dev mailing list