[mythtv-users] listing chanid vs. the channels as I know them

James Abernathy jfabernathy at gmail.com
Mon Oct 10 10:33:40 UTC 2022


On Sun, Oct 9, 2022 at 9:21 PM Stephen Worthington <stephen_agent at jsw.gen.nz>
wrote:

> On Sun, 9 Oct 2022 11:27:53 -0400, you wrote:
>
> >Thanks, this is very useful.  I got what I needed out of a simple:
> >select chanid,channum from channel; but yours is more useful.
> >
> >I tried to update my power search record rule to use channum but that
> >failed.  So I guess I'll have to run the mysql query and find the chanid
> >from the printout and just plug that into the Power Search.  I don't
> >understand it, but it works.
> >
> >Jim A
>
> It should be possible to use channum in a power search rule.  I would
> suggest something like this:
>
> program.title='College Football' and program.chanid not in (select
> chanid from channel where channel.channum='1');
>
> Change the channum '1' to the channel you want.  Note that the channum
> field is actually a char field, so you need to provide a character
> string not a number when using it.  Or use 'channum+0' to convert it
> to an integer to use it in a numeric context.
>
> Doing a more complex (and multi-table) query like that will slow down
> the scheduler a little bit though.
>
> As I understand it, power search SQL is done in the context of the
> program table, and any reference to other tables has to use the name
> of the table (like channel.channum, not just channum).  So I tested
> the above SQL like this:
>
> MariaDB [mythconverg]> select * from program where
> program.title='College Football' and program.chanid not in (select
> chanid from channel where channel.channum='1');
> Empty set (0.001 sec)
>
>
I seem to have a handle on this with the exception of the chanid's I have
right now.  On a test system built with Master and only HDHR network
tuners, I have the chanid equal to 1 + atcs major + '0' + atcs minor.  i.e.
22_2 becomes 12202.

But on my production backend where I want these power searches, I have HDHR
and Hauppauge WinTV-qualHD tuners.

There I seem to have all the normal chanid  plus the weird ones that make
no sense to me. For example channel, 22_2, is in the query output twice:
chanid 12202 and 16223.

So it sounds like I need a more complicated powersearch that uses channum
to index the channel table so the result excludes any recording for either
of the chanid's for channum 22_2.

Jim A.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20221010/c6d15efc/attachment.htm>


More information about the mythtv-users mailing list