[mythtv-users] Feature request

Chris Delis cedelis at uillinois.edu
Tue Mar 2 09:11:52 EST 2004


Actually, here's a better version (I think).  It accepts the channel
numbers as arguments.  So, now you needn't edit the script every time
you use the script.

e.g., 

perl delete_chanid.mysql 351 352 353



On Tue, Mar 02, 2004 at 08:06:06AM -0600, Chris Delis wrote:
> In the meantime, you can use the attached script.  It does what the FAQ
> recommends, but will accomodate a list of channel numbers to delete.
> 
> You just need to edit the top part of the script.  Add the numbers you
> wish to delete in the "@delete_channels" list and make sure you enter
> the username and password correctly in "$mysqlcmd".
> 
> e.g.,
> 
> @delete_channels = (
> 351,
> 352,
> 353,
> );
> $mysqlcmd = 'mysql -N -umythtv -pmythtv mythconverg';
> 
> 
> On Tue, Mar 02, 2004 at 08:47:49AM -0500, James Armstrong wrote:
> > I already found this info and did it with the exception of the database
> > stuff. I could not edit the database, getting Access Denied. I also had
> > to remove about 50 channels which can be a pain. I just thought it would
> > be nice enhancement like the Tivo, it allows you to choose the channels
> > you want in the EPG. I always remove the home shopping channels and
> > stuff like that. There is an Edit Channels in the setup, it just does
> > not have a 'Remove Channel' option. Wouldn;t that  be a simple thing to
> > add?
> > 
> > - James
> > 
> > Bruce Markey wrote:
> > 
> > 
> > James Armstrong wrote: 
> > 
> > 
> > It would be nice to be able to delete unused channels from the 'Channel
> > Configuration' screen instead of having to edit the XML file and delete
> > the channels from the database manually. I was able to edit the XML file
> > but could not remove them from the database. I would get 'Access denied'
> > from msql. I have basic cable and needed to remove a bunch of channels. 
> > 
> > 
> > 
> > http://www.mythtv.org/docs/mythtv-HOWTO-21.html#ss21.8
> > <http://www.mythtv.org/docs/mythtv-HOWTO-21.html#ss21.8>  
> > 
> > --  bjm 
> > 
> > 
> >  _____  
> > 
> > 
> > _______________________________________________
> > 
> > mythtv-users mailing list
> > 
> > mythtv-users at mythtv.org <mailto:mythtv-users at mythtv.org> 
> > 
> > http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
> > <http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users> 
> > 
> >  
> > 
> > 
> 
> > _______________________________________________
> > mythtv-users mailing list
> > mythtv-users at mythtv.org
> > http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
> 

> #!/usr/bin/perl
> 
> @delete_channels = (
> 351,
> );
> $mysqlcmd = 'mysql -N -umythtv -pmythtv mythconverg';
> 
> $sql = "select chanid from channel where channum in (";
> $sql .= join (',', @delete_channels);
> $sql .= ");";
> $res = `${mysqlcmd}<<EOF
> $sql
> EOF`;
> 
> (@ids) = split (/^/, $res);
> $sql = '';
> foreach $id (@ids) {
>    chomp ($id);
>    $sql .= "delete from channel where chanid = ${id};\n";
>    $sql .= "delete from program where chanid = ${id};\n";
> }
> 
> $res = `${mysqlcmd}<<EOF
> ${sql}
> EOF`;
> 
> print $res;

-------------- next part --------------
#!/usr/bin/perl

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

$sql = "select chanid from channel where channum in (";
$sql .= join (',', @ARGV);
$sql .= ");";
$res = `${mysqlcmd}<<EOF
$sql
EOF`;

(@ids) = split (/^/, $res);
$sql = '';
foreach $id (@ids) {
   chomp ($id);
   $sql .= "delete from channel where chanid = ${id};\n";
   $sql .= "delete from program where chanid = ${id};\n";
}

$res = `${mysqlcmd}<<EOF
${sql}
EOF`;

print $res;


More information about the mythtv-users mailing list