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

Simon Hobson linux at thehobsons.co.uk
Mon Nov 3 08:13:51 UTC 2014


Bill Meek <keemllib at gmail.com> wrote:

> If user's contributed libraries, then the original task of setting visible
> to false would look like this (in Python):
> 
>    import Channel
>    Host='someHostName'
>    for chanid in '1021', '1091', etc.
>        channelDict = Channel.GetChannelInfo(host=Host, chanid=chanid)
>        channelDict['Visible'] = 'false'
>        Channel.UpdateDBChannel(host=Host, rdict=channelDict)
> 
> I'd say that's a very reasonable substitute for the SQL, and much safer, Once
> the key issue is resolved (easily handled in the Channel module for now.)


I disagree.
Yes it's a substitute, and probably workable, but from what I'm seeing it looks like a very inferior substitute.

It looks like a simple statement :
> update channel set channum=channum+10000 where channum < 1000 and not channum between 700 and 799
becomes a loop where I've got to work through all the channels, perform a test, and update some of them.

Then each statement of the form :
> update channel set visible=1,channum=1,xmltvid="north-west.bbc1.bbc.co.uk" where callsign="BBC ONE N West"
alos becomes several statements - in practice I'll need to loop round, but bear in mind I have different settings for different channels, eg :
> update channel set visible=1,channum=27,useonairguide=1,xmltvid="freeview.quest.discoveryeurope.com" where callsign="QUEST"

SO a very simple list of statements becomes a significant coding exercise.



More information about the mythtv-users mailing list