[mythtv-users] mythtv-users@snowman.net
Martin Cosgrave
martin at bettercode.com
Mon Jun 9 11:57:39 EDT 2003
> So what I want to know is how I can "teach" MythTV which frequencies
> belong to which channels. Anyone?
Had a similar problem in the UK while receiving cable TV signals which are
modulated at different frequencies to the standard pal europe-west
frequencies, in some cases.
Wrote a little script to try all the frequencies and figured out which ones
had channels on.
I hacked the "channel" table to make the 'channum' field a varchar(6) instead
of varchar(5), then after I run mythfilldatabase I run another script which
puts the actual frequencies into the channum field. This works out handily
for passing to 'ptune.pl -f europe-west -F' in the channel change command
field in myth.
--8<-- fix_myth_channels.pl --8<--
#!/usr/bin/perl -w
use strict;
# in %chans hash, key is the xmltv id, value is the frequency
my %chans = qw/
west.bbc1.bbc.co.uk 471250
west.bbc2.bbc.co.uk 487250
west.htv.co.uk 503250
channel4.com 519250
channel5.co.uk 311250
news-24.bbc.co.uk 63250
sky-one.sky.com 271250
thebox.co.uk 351250
british.eurosport.com 55250
/;
use DBI;
my $dsn = "DBI:mysql:database=mythconverg";
my $dbh = DBI->connect($dsn, "user", "password") or die $!;
my $sql = "";
for my $key (keys %chans)
{
$sql = "update channel set channum='$chans{$key}' where
xmltvid='$key'";
print "$sql\n";
$dbh->do($sql) or die $!;
}
More information about the mythtv-users
mailing list