[mythtv-users] Duplicate Channels Cleanup

Michael T. Dean mtdean at thirdcontact.com
Mon Sep 15 22:18:51 UTC 2014


On 09/15/2014 02:38 PM, Eric Sharkey wrote:
> On Mon, Sep 15, 2014 at 11:37 AM, Michael T. Dean wrote:
>> On 09/15/2014 10:25 AM, Martin Compton wrote:
>>> I was cleaning up my DISH-TV Schedules Direct listings and ran
>>> mythfilldatabase to update the channels.
>>>
>>> When I was checking the channels table I noticed that some have 2-3
>>> duplicate entries for the same sourceid+channel+callsign+xmltvid (etc).
>>>
>>> Can I safely reassign the chanid in the associated tables:
>>> channelgroup
>>> program (these duplicates can be deleted)
>>> programgenres
>>> programrating
>>> record
>>> recorded
>>> oldrecorded
>>>
>>> and remove the duplicate channels?
>>>
>>> Am I missing any tables with a "chanid" column?
>>
>> The proper way to handle "ghost" channels (as you get when you don't
>> properly set the XMLTV ID on channels before running mythfilldatabase and
>> your broadcasters provide in-stream information about the channel that
>> mythfilldatabase can't match to one of your scanned channels) is to "Delete
>> all video sources" (to clear out everything--both the good and the bad
>> channel info--from all the tables that are affected) and then rescan, set
>> the XMLTV ID's, then run mythfilldatabase.
> You've posted this response before.  I can't say I recall anyone
> agreeing that this is the best approach.  There's too much collateral
> damage.

No, there's none--unless you change your channel call signs /and/ you 
use "this channel" filter on your recording rules.

> Martin, I think your originally posted plan is best.  There is no good
> automated way to remove a channel that doesn't leave dangling foreign
> key references from other tables.

If you delete channels using MythWeb or mythtv-setup channel editor, the 
non-configuration data (listings, genres, credits, ...) in other tables 
that's left in place will be cleaned up automatically over a period of a 
couple weeks.

Only (broken) configuration data that you leave in place will be left in 
place.  However, if you "Delete all video sources", it will clean up 
/all/ configuration data--including both broken and not-broken--leaving 
a completely empty configuration so that the only configuration data you 
have is what you add (which should be proper configuration data, 
assuming you configure things correctly).  This is why clearing 
everything is best--because it gets all the bad configuration data you 
know about /and/ the bad configuration data you don't know about (as 
well as getting rid of all the non-configuration data immediately, 
though that's no big deal since it's a tiny amount of data compared to 
the overall database size).

Mike


More information about the mythtv-users mailing list