clievers Site Admin
Joined: 07 Sep 2005 Posts: 164
|
Posted: Mon Oct 06, 2008 2:26 pm Post subject: Duplicate Channel Listings in MythTV |
|
|
Duplicate Channel Listings in MythTV
So I've had this issue for the past while, where the program listings in my mythfrontend and mythweb had a number of channels that only showed "NO DATA" - not the actual shows. Then one day I realized, when searching for a show, it was finding the program on one of those channels that showed "NO DATA". I thought that was very strange, that program details were there, but I just couldn't see them. Thus the investigation...
It turns out, my cable tv provider, Shaw Cable, had gone through a series of lineup changes (moving channels around, etc). Well, my mythtv is set to update channel listings, to pick up new channels. So, the information was there, if searching on an actual Show, but when browsing the listings, the listings were only showing the earliest channel. So if I had two "Channel 4" in the database, my listings showed the irrelevant one. So, I concluded I had to go through my database and delete the channel's no longer in use.
Mythtv pulls the guide data from SchedulesDirect, so I logged into my account and wrote down all of the channel's (and their callsign/callname). Then, I got all of the channel information from the mythtv database (mythconverg).
| Code: | | select chanid, channum, callsign, name from channel order by channum; |
I then compared side-by-side to see what channels existed in the database, that should not be there (they were incorrect while comparing to the data from SchedulesDirect). From this comparison, I got a series of "chanid"'s (1004,1010,1013,1034,1038,1047,1045,1054,1094,1086,1085,1070). These were the ones that were invalid. Just to double check, for each of these channel id's, I checked the database to see if there any programs for the channel, unlikely since guide data is for 14 days only. For each channel, I ran the sql query:
| Code: | | select chanid, starttime, endtime, title from program where chanid = #Put-ChanId-Here#; |
Sure enough, there was no program data (if there was program data, likely you would want to delete the program data for that channel prior to deleting the channel). Time to delete the channels.
The easiest way is to run one sql statement to delete the channel's, rather then running a dozen different one's. This way is using mysql's "IN" keyword:
| Code: | | delete from channel where chanid IN(1004,1010,1013,1034,1038,1047,1045,1054,1094,1086,1085,1070); |
Now, when I pull up my listings, I have no more "NO DATA" channel's, and the data is there. Sweet! _________________ Let's all play nice!!
http://www.cory.lievers.ca |
|