[mythtv-users] channels.conf <--> myth database synchronisation

Brian May bam at snoopy.apana.org.au
Wed Mar 24 22:44:58 EST 2004


Hello,

I have started writing a perl script that will read in channels.conf
and use it to synchronise the dvb_channels and dvb_pids tables in
MythTV.

Currently it needs more work to be totally generic (I got confused
trying to translate the channels.conf file to the dvb_channels table,
and haven't yet referred to a reference... What is the best
documentation?).

Also, currently it is read-only, i.e. it doesn't make any changes to
the database, it just outputs the result as SQL. I haven't yet tested
this SQL, so beware! It looks OK to me though. At the moment at least,
it should be totally safe to run on an existing database without
corrupting anything (check to make sure this hasn't changed...) since
it is read-only.


To use, create a file:

sync-channels-myth.conf

which was the relationships between the entries in channels.conf, and
the database chanid of the channel (from the channel table), one per
line:

channel.conf_name:chanid

(I was considering using "callsign" or "name" to do this translation,
but for now decided to stick with chanid).

Format of the config file subject to change.


It automatically reads /etc/mythtv/mysql.txt to get database details.


Run it (in the same directory as the conf file) with

sync-channels-myth < channels.conf

Available from
<URL:http://snoopy.apana.org.au/debian/experimental/sync-channels-myth/>.
(also available via Arch/TLA repository in case anyone is interested;
details on request).

Is this of interest to anybody?

Patches welcome, especially to the two areas marked "FIXME". The first
FIXME region is for translating columns from channels.conf into that
expected by the table. The second one is for writing these values into
the correct locations in the table. Possibly the code to read in
channels.conf is very specific to DVB-T, too.
-- 
Brian May <bam at snoopy.apana.org.au>


More information about the mythtv-users mailing list