[mythtv-users] Converting scripts to not use the database directly
Mike Bibbings
mike.bibbings at gmail.com
Sat Nov 1 10:41:15 UTC 2014
On 01/11/14 01:17, Mike Rice wrote:
> Over the years I've developed the bad habit of changing things in the
> database directly or using scripts to do it. After the recent
> discussion about using an embedded database I decided to try to get
> rid of these scripts and refrain from editing the database.
>
> So far I've replaced a recording_started bash script with a perl
> script using the bindings. That went pretty well but I was only
> accessing data and not updating anything.
>
> Next problem: I have channels that I need to toggle the visibility of
> at certain times of the year. These are channels that show hockey
> part of the year and baseball other part. Assuming I only subscribe
> to one and not the other I need them to go away for awhile.
>
> I assume this can be done manually with the channel editor but I don't
> normally have a keyboard attached and rather do it with a script.
> Looks like I can do it with mythweb too. A nice script I can run a
> few times a year would be easier to me.
>
> Anyone have a script to do this that doesn't modify the database
> directly? Or can someone point me to an existing script that can
> change the attributes of a channel? Or some info on how to do this in
> general?
>
>
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://www.mythtv.org/mailman/listinfo/mythtv-users
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org
I think the general approach would be to use Mythtv Services API.
See https://www.mythtv.org/wiki/Services_API
In particular, to change the visible flag you could use
Channel/UpdateDBChannel API
Note that the documentation on these API is sparse in some cases.
Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mythtv.org/pipermail/mythtv-users/attachments/20141101/bd2c5ac6/attachment.html>
More information about the mythtv-users
mailing list