[mythtv-users] Rehash of a recent "Feature request"

Dan Davis dandavis-web-myth at dandavis.com
Sun Mar 7 21:26:29 EST 2004


Someone posted a script to remove "deleted" channels from the database.
The versions sent to the list relied on the user specifing the list of
channels to delete.

However, if you just setup Myth and didn't update your *.xmltv config file
before you ran mythfilldatabase file, it'll be more than a couple channels
being removed... after I went back and figured out which channels I didn't
want, I had some 500 channels to delete...

So, I updated the script to read from the *.xmltv file and delete from the
database all the channels prefixed with "not ". A quick and painless
change...

Replace:
---------------------------------------------------------
@delete_channels = (
351,
352,
353,
);
$mysqlcmd = 'mysql -N -umythtv -pmythtv mythconverg';
---------------------------------------------------------

With:
---------------------------------------------------------
$channellist = "/home/mythtv/.mythtv/Dish Network.xmltv";

open (CHANLIST, $channellist);
while ($entry = <CHANLIST>) {
        next if ($entry !~ /^not channel/);
        ($not,$chantext,$channel,$name) = split/\s/,$entry;
        push @delete_channels, $channel;
}
close (CHANLIST);

print "Deleting " . scalar(@delete_channels) . " channels...\n";

$mysqlcmd = 'mysql -N -umythtv -pmythtv mythconverg';
---------------------------------------------------------

Dan


More information about the mythtv-users mailing list