[mythtv-users] Computing channel.chanid

Larry K lunchtimelarry at gmail.com
Tue Aug 17 02:57:25 UTC 2010


On Mon, Aug 16, 2010 at 10:36 PM, Daniel Kristjansson
<danielk at cuymedia.net>wrote:

> On Mon, 2010-08-16 at 20:28 -0400, Larry K wrote:
> > Comcast is changing my QAM channel layout every other day it seems, so
> > I'm getting tired of rescanning channels in mythtv-setup.  it's soooo
> > tedious to fix all the channel numbers and xmltvids post-scan.  So, I
> > borrowed a script from the HDHR forum to insert the correct channels.
> >  I have it almost ready to go, except that the script is borking the
> > chanid by supplying an alphanumeric value.  It needs to be numeric.
> >  Does anyone know how mythtv calculates the chanid value when
> > inserting a new channel?  Most of the time, it looks like some funky
> > combination of (sourceid*1000) + serviceid, but not always.
>
> The chanid is arbitrary. There is a sourceid*1000 + int(channum)
> type thing that tries to pick chanid's that humans debugging the
> program will find appealing.. but it doesn't try very hard to do
> so and will pick non-conflicted chanid's pretty arbitrarily if
> there is any kind of collision. What is important is that the same
> chanid is used in other tables referring to that channel.
>
> --Daniel
>
>
>
Every time you rescan the channels in mythtv-setup, the chanids are subject
to change, right?  The rows in the channel table get deleted and re-added
AFAIK.  So, how do these ever-changing chanids get reconciled against all
the other tables that make reference to chanid?  Like, channelgroup?  I see
nothing like a cascading delete FK relationship that could be cleaning the
other tables when the channel table gets purged.  This makes me wonder if it
is even possible to script the loading of new channels outside the mythtv
scan process.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mythtv.org/pipermail/mythtv-users/attachments/20100816/01d67617/attachment.htm>


More information about the mythtv-users mailing list