[mythtv-users] Computing channel.chanid

Larry K lunchtimelarry at gmail.com
Tue Aug 17 12:27:37 UTC 2010


On Mon, Aug 16, 2010 at 10:57 PM, Larry K <lunchtimelarry at gmail.com> wrote:

> 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.
>
>
>
> Maybe mythfilldatabase just makes all this right?  Cleans up orphan rows in
the child tables, and sets up the new relationships as needed after a
rescan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mythtv.org/pipermail/mythtv-users/attachments/20100817/2fa4ea8d/attachment.htm>


More information about the mythtv-users mailing list