[mythtv-users] delete channels from listing with no data

Jan Ceuleers jan.ceuleers at computer.org
Tue Jan 6 16:29:13 UTC 2009

Dan Littlejohn wrote:
> Is there an easy sql command to delete channels from the database?
> Channels keep getting added to my schedules direct feed (new channels) and
> most of them are junk like music or pay per view so I disable them, but the
> channels don't disappear from the listings so there are all these entries
> that just show "NO DATA".

See Brad's reply for how to do it properly, but I also have a method.

My schedules grabbing script (not using SchedulesDirect) results in 
phantom channels being created(*), which I delete using the following 
SQL snippet:

delete from program where chanid not in (select chanid from channel);
delete from programrating where chanid not in (select chanid from channel);

HTH, Jan

(*) The reason is that in my case I use a range of grabbers to create 
one listings file, that I then apply to both of my video sources. One of 
these video sources is better quality than the other but has only a 
subset of channels available (DVB-T versus cable). So phantom channels 
are created, complete with listings, on the DVB-T source. I could avoid 
this by creating separate listings files for each video source but that 
would take longer and impose a higher load on the (probably already 
reluctant) listings websites being scraped by the grabbers.

More information about the mythtv-users mailing list