[mythtv-users] Converting scripts to not use the database directly

Simon Hobson linux at thehobsons.co.uk
Tue Nov 4 15:25:17 UTC 2014


"Michael T. Dean" <mtdean at thirdcontact.com> wrote:

>> BTW - is doing an update really just "channel.SetVisible(false)" or is there more to it than that ?
> 
> That is the plan--simple to select with some arbitrary combination of criteria and simple method calls to change one or more values of the object.  Much of it is already available, though it will become even easier (for example, as more of the Services API becomes available/useful and as the Python bindings start wrapping the services API to make an easy-to-use API).

OK, that's sounding better than I expected.

>> Clearly, the examples you give are "designed for the job". Since there is no "designed for the job" function that will automagically (in my example) setup the channels as I like them, then it needs to be done via an alternative method.
> 
> No, the right solution is to have designed for the job functionality to do whatever you need more easily than can be done with even SQL.

In general, yes.
I'll be interesting to see if you can get to that level of flexibility !

> since we've been talking about editing channel lists, I'll stick with that example--in the mythtv-setup and backend web server channel editor, the user can select a bunch of channels by specifying arbitrary criteria and/or by manual selection and then apply changes to all of them (i.e. set them all as not visible or disable EIT on all of them or increase channel number by 1/5/10/25/100/1000 or do whatever).  And we need to do similarly for recordings--select a bunch using arbitrary criteria and/or manual selection, and then apply any user-editable data change to them all--and anything else that users may need to edit...

That alone isn't sufficient to replace my existing script - though I can see that it would make quite a few "through the back door via SQL" changes unnecessary.


> In other words, the goal is for scripting (in SQL or Python or whatever) to be the exception and not--as it seems to be today (at least to some users)--the rule.

And that is a worthy goal. If you achieve it then I think I'll be happy.

> If the internal-only data needs changing, that means there's a serious bug in MythTV and the proper fix is to fix the bug, not allow user editing of the internal-only values via the UI.

No argument there !





More information about the mythtv-users mailing list