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

Fred Squires fsquires at gmail.com
Wed Jan 20 14:00:05 UTC 2010


On Wed, Jan 20, 2010 at 12:54 AM, Michael Rice <mikerice1969 at gmail.com> wrote:
> On Tue, Jan 19, 2010 at 10:05 AM, David Engel <david at istwok.net> wrote:
>> 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.
>
> Yep.  Everything is the same except the callsign/channel.
>
>> 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.
>
> Thanks David this is almost working.  One wrinkle is my Center Ice
> lineup does not use consecutive
> channel numbers:
>
> 457 GAME11
> 458 GAME12
> 459 GAME13
> 460 GAME14
> 461 GAME1
> 462 GAME2
> 463 GAME3
> 464 GAME4
> 465 GAME5
> 466 GAME6
> 467 GAME7
> 468 GAME8
> 469 GAME9
> 470 GAME10
>
> So I think I need to convert the callsign to a number and use that
> instead of the channel.
> Hopefully I can figure out how to do that.  Or maybe I will just
> rename the callsigns if
> I have to.
>
> And since 471 is GAMEHD which I want to always win over the SD
> channels I can add
> another rule that adds +14 and I should be good.

Is it possible to add priority by a variable amount?
Such as adding the channel number to the priority of the recordings.

So for home games, where the title contains "At TeamName", you could
add the channel number to the priority.

And for away games, you could add something like 500 minus the channel
number to the priority.

This assumes that you'd want to record the game more than any other
program because it would probably be much higher than your other
priorities, but I think this would at least give the correct channel
the higher priority.

I'm not sure if this is even possible, since I haven't played with
custom priorities.


More information about the mythtv-users mailing list