[mythtv] Format of new post-0.25 config.xml

Michael T. Dean mtdean at thirdcontact.com
Sat Jun 2 20:33:13 UTC 2012


On 06/02/2012 04:07 PM, Brian J. Murrell wrote:
> In any case, the whole thing is supposed to find "pilots and premieres"
> but only those that are not already scheduled to be recorded.
>
>> ------
>> #!/usr/bin/env python
>> import MythTV
>> rules = [r.recordid for r in MythTV.Record.getAllEntries() if r.title is
>> None]
>> for prog in MythTV.MythBE().getUpcomingRecordings():
>>      if prog.recordid not in rules:
>>          continue
>>      chan = MythTV.Channel(prog.chanid)
>>      print "{0}/{1.callsign:<8} {1.title:<40} {1.subtitle:<30}
>> {1.starttime}".format("A" if chan.sourceid==1 else "D", prog)
>> ------
> This returns nothing.  Probably because of the requirement of r.title
> being None.  But when I remove that, I'm not getting the results I am
> looking for which is "pilots and premieres" not already scheduled for
> recording.
>
> Cheers, and thanks much!

If you set up an inactive recording rule to catch "first episodes" 
and/or pilots and/or premieres, then MythTV.Record.getAllEntries() would 
actually return entries for them, then you just filter for the 
appropriate ones/filter out the rest.

The other benefit of this approach is that you could also see the output 
in, for example, the MythWeb or mythfrontend Upcoming Recordings 
sections or the EPG--MythTV would actually mark shows everywhere so you 
could see them and choose whether to record them or not.  Because an 
inactive rule always has lower priority than an active rule, you 
wouldn't even have to worry about the "if it's not already scheduled to 
record" part--that would be handled automatically.

Similar to:  
http://www.gossamer-threads.com/lists/mythtv/users/188789#188789 .  
Note, however, that due to the fact that some networks (yes, I'm looking 
at you, Fox), love to air episodes of a series out of order, the example 
rule may not work "out of the box".  Because of that, I've set up my 
inactive First Episodes rule to include any program with the subtitle 
"Pilot" (though you could easily look for the word pilot in the subtitle 
or description with an appropriate LIKE clause).  I use:

program.previouslyshown = 0
AND program.first > 0
AND (program.programid LIKE 'EP%0001' OR program.subtitle = 'Pilot')
AND DAYOFYEAR(program.originalairdate) =
     DAYOFYEAR(program.starttime)

Mike


More information about the mythtv-dev mailing list