[mythtv-users] listing chanid vs. the channels as I know them
David Engel
david at istwok.net
Tue Oct 11 23:03:47 UTC 2022
On Tue, Oct 11, 2022 at 05:21:02PM -0400, James Abernathy wrote:
> On Mon, Oct 10, 2022 at 6:33 AM James Abernathy <jfabernathy at gmail.com>
> wrote:
>
> >
> >
> > 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.
> >
>
> Thanks for the help. I ended up with this Power Search;
>
> program.title='College Football' and program.chanid not in (select chanid
> from channel where channel.channum='28_1' or channel.channum='22_2')
>
> This gave me all the College Football games recorded except those on
> channels 28_1 and 22_2 which are a lot of rebroadcasts of second tier teams.
The channel table is alread available so you use the following,
simpler query:
program.title='College Football' and
channel.channum not in ('28_1', '22_2')
That's not tested, but should be close to what you need.
David
--
David Engel
david at istwok.net
More information about the mythtv-users
mailing list