[mythtv] Services API for ChannelServices / Channel

David Engel david at istwok.net
Tue Dec 3 03:27:12 UTC 2019


On Mon, Dec 02, 2019 at 11:01:53PM +0000, Gary Buhrmaster wrote:
> On Mon, Dec 2, 2019 at 10:20 PM David Engel <david at istwok.net> wrote:
> 
> > Also, I don't think the update
> > only the chagned values will work in the general case.  It might not
> > be possible to validate the changed values without knowing some of the
> > unchanged values too.
> 
> To pile on a bit.....
> 
> It has been my experience that the
> current services API, in some cases,
> is fundamentally too low level, allowing
> one (today) to set values that are (at
> best) brain dead, and there is a lack
> of business logic consistency applied
> to the provided values (and in some
> cases there is no way to apply the
> proper business logic because those
> relationships are not exposed for
> add/updates (my pet example is creating
> channels that require creation of a new
> dtv_multiplexes, but you can't do that
> (or you could not when I last checked))).
> 
> In essence, some of the API endpoints
> are just fancy direct database updates,
> with all the (dis)advantages of such.
> My codes have had to try to implement
> the business logic, and while I have
> tried to read the relevant codes, it
> could easily be incorrect, and whether
> I would notice a change in business
> logic in some MythTV commit is a
> crap shoot.  This feels excessively
> fragile.

I agree.

> Unfortunately, I don't see an easy
> way forward (all the ways I think
> of require some significant resources).

All I can suggest is we should try to make things as generic and
abstract as we can.  For example, the dtv_multiplex table should never
be directly visible in the API.  It should be handled magically behind
the scenes through the channel updates.  There are probably other tables
that should be handled similarly.  diseqc tree, anyone?

Alas, I'm sure some APIs will have to remain very low-level.  For
example, I don't ever expect the capture card handing(*) to really be
usable by anything except the built-in, web interface.  Of course,
that's assuming someone eventually finds that round tuit.

David

(*)IMHO, those particular, service APIs should be disabled until they
are fixed.  As currently constituted, they are very dangerous and
their use could easily lead to incorrect card configurations.

David
-- 
David Engel
david at istwok.net


More information about the mythtv-dev mailing list