[mythtv-users] the right way to do tuner priority?

Karl Newman newmank1 at asme.org
Mon Sep 29 16:06:37 UTC 2014


On Mon, Sep 29, 2014 at 8:16 AM, Brian J. Murrell <brian at interlinx.bc.ca>
wrote:

> On Mon, 2014-09-29 at 10:38 -0400, Michael T. Dean wrote:
>
> > None required (or recommended).  You can use Custom Priorities.
>
> How do I to time-of-day/day-of-week clauses in those rules?  i.e. Sunday
> evening from 6pm until 11pm.  Something like:
>
> DAYOFWEEK(CURDATE()) = 1 AND HOUR(CURTIME()) > 18 and HOUR(CURTIME() < 23
>
> perhaps?  So altogether:
>
> channel.callsign = "WWNY" and DAYOFWEEK(CURDATE()) = 1 AND
> HOUR(CURTIME()) > 17 AND HOUR(CURTIME()) < 24
>
> Yes?
>
> Cheers,
> b.
>

I know you already found the root of your issue but I wanted to mention
that the powerpriority rules match against *program* entries, so you
wouldn't use CURDATE(), you'd use starttime (or possibly program.starttime
if it's ambiguous). And since all the mythtv times are in UTC, you'd use
CONVERT_TZ(starttime,'UTC','SYSTEM'). So your full powerpriority
selectclause would look something like this:

channel.callsign = 'WWNY' AND
DAYOFWEEK(CONVERT_TZ(starttime,'UTC','SYSTEM')) = 1 AND
HOUR(CONVERT_TZ(starttime,'UTC','SYSTEM')) BETWEEN 18 AND 23

You don't have to use the BETWEEN clause. It's just a handy shortcut for
>=18 and <=23.

Karl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mythtv.org/pipermail/mythtv-users/attachments/20140929/909ba3af/attachment.html>


More information about the mythtv-users mailing list