[mythtv-users] if (x!=rerun) {record}

Bruce Markey bjm at lvcm.com
Fri Oct 21 14:35:21 EDT 2005


Michael T. Dean wrote:
> Fred Squires wrote:
> 
>> On 10/20/05, *Todd Houle* <thoule at wesleyan.edu 
>> <mailto:thoule at wesleyan.edu>> wrote:
>>
>>     I need a little help running a reruns rule.  I'd like the following
>>     rule for recording, but I can't seem to find where/how to enter it.
>>
>>     I'd like to record a show and keep at most 4 episodes of it.  If
>>     there's anymore, don't record them until I watch the old (this part
>>     I'm doing).  However, if it's not a rerun, then record it anyway -
>>     either delete and old one, or just record it in addition.
>>
>> Right now there's no way to do that, other than manually doing it.
>> It would be great if you could give new episodes a higher priority
> 
> In SVN, you could create a custom record rule for new episodes only and 
> assign a priority for that.  Then, create a rule for old episodes.  Or, 
> assuming you do this after creating the custom record rule for new 
> episodes, just create a rule for record all.  If you use the same rule 
> type (i.e. this channel or all channels) for both, the all episodes rule 
> must be created after the new episodes rule so it can match first.  If 
> you make a more specific rule for the new episodes (i.e. use this 
> channel for new episodes and any channel for all episodes), it doesn't 
> matter what order they're created in.

Outstanding. Your ability to absorb information then present in an
easy to digest manner is always impressive. I really hope you spend
some time at some point going over the HOWTO to clarify things you
commonly respond to so that you can reply with links to the docs.
But that's another matter.

> Then, assign priorities to the rules as desired.
> 
> I hope I got this all right, but I'm sure Bruce Markey will chime in 
> with corrections to any misinformation here...  He's the man with the 
> answers for recording rules--especially custom recording.  ;)

You rang? I started a reply to this last night but got mired in the
details of making sure the power search for new rules had precedence
and the issue of total episodes for two rules.

Todd, What Mike said. Here are the gory details.

I'll guess we're talking about "The Simpsons". If not, it's a typical
example for the situation described. There are new episodes Sunday
evening on FOX and years of reruns on the same or different channels
throughout the week. You want a limited number of reruns but still
record new episodes. You may even want a different priority or profile
for the new ones.

This can be done with two different rule. One that applies to new
episodes only and one that will match any other showing. As Mike
mentioned, the rule for new episodes has to match only the new
episodes and take precedence over the other rule. I'll use the
output of "mythbackend  -v schedule" to illustrate. Because of
the World Series, there isn't a new Simpsons this week so I faked
one in my test DB program table.

First, if I set a simple "All" rule. It matches three episodes:

--- print list start ---
Title - Subtitle                    Chan ChID Day Start  End   S C I  T N Pri
The Simpsons - "Diatribe of a Mad H   14 1014  21 18:30-19:00  1 1 1  A 1   0
The Simpsons - "Margical History To   14 1014  21 19:30-20:00  1 1 1  A 1   0
The Simpsons - "Brand New Bart"        5 1005  23 20:00-20:30  1 1 1  A 1   0

The "T"ype is "A" and they are all scheduled to record on card 1.
If I set "Record new episodes only", it will mark the reruns as
"r"epeat.

The Simpsons - "Diatribe of a Mad H   14 1014  21 18:30-19:00  1 0 0  A r   0
The Simpsons - "Margical History To   14 1014  21 19:30-20:00  1 0 0  A r   0
The Simpsons - "Brand New Bart"        5 1005  23 20:00-20:30  1 1 1  A 1   0

This rule still controls all three episodes but we want a different
rule for the reruns so we need a rule that will only match the new
episodes. To do this, I remove this rule, go to Custom Record and
create this rule:

program.title = 'The Simpsons'
AND program.previouslyshown = 0

from "Match an exact title" and "New episodes only". See:
http://www.mythtv.org/docs/mythtv-HOWTO-11.html#ss11.8 . I click
"Record" to set a new rule with no episode limit but I bump up the
priority a bit to make sure I get these new episodes.

The Simpsons - "Brand New Bart"        5 1005  23 20:00-20:30  1 1 1  A 1   2

This rule only matched the new episode and set the priority to 2.
Next I find one of the old episodes. There is no existing rule
so I can create a new one. I choose All but this time I lower the
priority by 1, set "Keep at most 4 episodes" and "Don't record if
this would exceed the max episodes" then Save.

The Simpsons - "Diatribe of a Mad H   14 1014  21 18:30-19:00  1 1 1  A 1  -1
The Simpsons - "Margical History To   14 1014  21 19:30-20:00  1 1 1  A 1  -1
The Simpsons - "Brand New Bart"        5 1005  23 20:00-20:30  1 1 1  A 1   2

The reruns have -1 priority and only a max of 4 recorded by this
rule will be kept. New episodes will get +2 and an unlimited number
recordings. You could have 4 reruns and 2 new for a total of 6 but
presumably you'll watch the new ones as they come in and keeping
the total at exactly 4 is not a matter of life or death.

Note: the rule for new episodes has to take precedence. The more
specific type wins (Single beats Channel beats All) but in this
case they are both All. Therefore the rule for new episodes needs
to be created first to win the tie breaker for older rule. See:
http://www.mythtv.org/docs/mythtv-HOWTO-11.html#ss11.7 the last
item under "Scheduling decisions".

--  bjm


More information about the mythtv-users mailing list