[mythtv-users] Power recording rule to choose between dual feeds

David Engel david at istwok.net
Tue Jan 19 18:05:34 UTC 2010


On Mon, Jan 18, 2010 at 08:29:37PM -0800, Michael Rice wrote:
> On Mon, Jan 18, 2010 at 9:34 AM, David Engel <david at istwok.net> wrote:
> > On Mon, Jan 18, 2010 at 12:25:50PM -0500, Ronald Frazier wrote:
> >> > This is exactly the type of problem for which the custom priorities
> >> > feature was added. ?Go to Utilities/Setup / Setup / TV Settings /
> >> > Recording Priorities / Custom Priority and then add a new priority
> >> > rule. ?The clause for the new rule should look something like this:
> >> >
> >> > title = 'Some Sport' AND ( subtitle LIKE 'at MyTeam %Home' OR
> >> > ? ? ? ? ? ? ? ? ? ? ? ? ? subtitle LIKE 'MyTeam at %Away' )
> >>
> >> I've never noticed this feature before. So are you saying he can set
> >> it up with a single (simple) recording rule, and then use the custom
> >> priorities to give preference to one showing over the other?
> >
> > Yes, that's exactly what I'm saying.
> 
> This sounds good but I am not sure how to write it.  Here is an
> example from tonight.
> There are two showings of the game:
> 
> 1/18  5:00PM  458 GAME12  NHL Hockey - "Toronto Maple Leafs at
> Nashville Predators
> 1/18  5:00PM  459 GAME13  NHL Hockey - "Toronto Maple Leafs at
> Nashville Predators
> 
> The first is the Nashville feed and the second the Toronto feed.  I
> want the Toronto feed but
> my rule is going to record the first.  So I want the custom priority
> to bump the second game
> up one or bump the first one down one.
> 
> The other cases when there is only one feed or it is the home feed the
> first (or only) will be picked and
> it is fine.
> 
> To match this case I need more than the subtitle:

Are you saying the program information does not give any indication if
it is the home or away feed and you just know that when the game is
listed twice, the home feed is always on the lower numbered channel?
Ouch, that's more difficult, but it is still doable.  

You can exploit the same feature of MySQL the custom priority code
already exploits.  That feature is conditionals evaluate to 0 or 1 and
can be used in expressions.  Let's give this a try.  Keep in mind I
don't have the Center Ice package so I can't test this at all myself.

Your Leafs at home rule might look like the following

	( (program.title = 'NHL Hockey') * 
	  (program.subtitle LIKE '%at Maple Leafs%') *
	  (channel.callsign LIKE 'GAME%') *
	  (<lastgame_channum> - channel.channum) )

and your Leafs away rule might look like the following

	( (program.title = 'NHL Hockey') * 
	  (program.subtitle LIKE '%at Maple Leafs%') *
	  (channel.callsign LIKE 'GAME%') *
	  (channel.channum - <firstgame_channum>) )

where <firstgame_channum> and <lastgame_channum> are the numbers of
the first and last channels used for the Center Ice package.  The
intent is to give a preference to lower channel numbers for home games
and to higher channel numbers for away games.  N.B. Because you are
using the select clause to provide the actual priority boost, you
should set the regular priority value to 1 as the code internally just
multiplies them together.

Now, if you want to give preference to Leafs games on other channels,
you'll need to add another rule to do that.  Something like the
following might work.

	program.title = 'NHL Hockey' AND
	program.subtitle LIKE '%Maple Leafs%' AND
	channel.callsign NOT LIKE 'GAME%'

and give it a priority value large enough to overcome any boost the
Center Ice version might get.

David
-- 
David Engel
david at istwok.net


More information about the mythtv-users mailing list