[mythtv-users] mythfilldatabase channel updates
jan.ceuleers at computer.org
Thu Jun 19 19:32:27 UTC 2008
Mike LaPlante wrote:
> I just updated my SchedulesDirect to remove all the useless channels I
> don't watch. I know if I wait 2 weeks or so my guide should drop those
> channels, but is there a way to force that?
> I tried --do-channel-updates, didn't seem to help. Doing this remotely
> over ssh so I've only attempted command line solutions.
> Do I need to get into mythtv-setup and remove/recreate my cards,
> sources, and inputs?
I have a similar issue (which I've solved; see below). I think my
situation is similar to yours, so perhaps you can come up with a similar
solution as well.
I don't use SchedulesDirect, but instead I download an xml file on a
daily basis that a kind soul puts together using a number of web
scrapers. The problem is that this xml file contains a number of
channels that I don't actually receive on any of my tuners. When I
import the xml file using mythfilldatabase, it creates entries for those
I wanted to get rid of the phantom channels, so I went and looked for
what sets them apart from the "legitimate" channels, and I came up with
delete from channel where isnull(freqid) and char_length(channum)=0;
Having got rid of the channels, I also needed to get rid of any programs
that mythfilldatabase had imported for those channels:
delete from program where chanid not in (select chanid from channel);
The nightly script that does all of this looks like this:
gunzip -f guide.xml.gz
sed -ie 's/"ketnet"/"ketnet\/canvas"/g' guide.xml
sed -ie 's/"canvas"/"ketnet\/canvas"/g' guide.xml
mythfilldatabase --file 1 guide.xml
mythfilldatabase --file 2 guide.xml
mysql -h via.xperim.be -u $DBUserName --password=$DBPassword $DBName <
where removePhantomChannelsAndPrograms.sql contains the above two SQL
statements followed by quit.
Please don't just adopt the above without checking that the delete
statements don't remove any of your legitimate channels!!
More information about the mythtv-users