[mythtv] Small problems with xmltv 0.5.14
mike
wildcard at illuminatus.org
Tue Jul 1 15:51:12 EDT 2003
I just downloaded/installed xmltv 0.5.14 and found that it put
characters in the channum field of the channels table (why isn't this
field an int?).
Anyway, here's a script that I used to fix it.
**script follows**
#!/usr/bin/perl
# Written by Mike Nugent <mike at illuminatus.org>
# This script is GPLv2
use strict;
use DBI;
my $db = 'mythconverg';
my $host = '127.0.0.1';
my $user = 'mythtv';
my $pwd = 'mythtv';
my $dbh = DBI->connect("DBI:mysql:$db:$host", $user, $pwd);
my $sql_get = q{
SELECT chanid
, channum
FROM channel
};
my $sth_get = $dbh->prepare($sql_get);
my $sql_update = q{
UPDATE channel
SET channum = ?
WHERE chanid = ?
};
my $sth_update = $dbh->prepare($sql_update);
$sth_get->execute;
while ( my $row = $sth_get->fetchrow_hashref ) {
my $chan = $row->{channum};
$chan =~ s/C(\d+)\w+/$1/g;
print $row->{chanid} . ": " . $chan . "\n";
$sth_update->execute($chan, $row->{chanid});
}
--
Mike Nugent
Programmer/Author/Unix Expert
mike at illuminatus.org
"I believe the use of noise to make music will increase
until we reach a music produced through the aid of
electrical instruments which will make available for
musical purposes any and all sounds that can be heard."
-- composer John Cage, 1937
More information about the mythtv-dev
mailing list