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

Michael T. Dean mtdean at thirdcontact.com
Mon Jun 4 19:38:14 UTC 2012


On 06/04/2012 07:55 AM, Brian J. Murrell wrote:
> On 12-06-03 11:42 PM, Raymond Wagner wrote:
>> On 6/3/2012 16:02, Brian J. Murrell wrote:
>>> rules = [r.recordid for r in MythTV.Record.getAllEntries() if
>>> "Premieres and Pilots (Power Search)" in r.title]
>> This was nothing more than a dirty cludge to work around me not knowing
>> what recording rule you were using with a title set to NULL.  By all
>> means, just give the id directly, rather than try to pull it out of the
>> database.
> I see your point but FWIW, I like pulling it out of the database.

BTW, no need to use the "(Power Search)" in the conditional thanks the 
the "in r.title"--just give something unique enough that it only matches 
the desired rule.  That said, since it's only one rule, you can actually 
make it less of a mess by just getting the specific recordid.  Perhaps 
that's what Raymond was suggesting?

>> I would use "prog.recordid == 1234" as mentioned above, but other than
>> that, it should work, assuming inactive rules are still scheduled and
>> show up in the backend query in that manner.
> They do show up, the problem is so are the active rules, which are what
> I want to eliminate.  The purpose of this query is to get a list of
> things that are "new" and that I might want to record, which naturally
> should exclude any rules which I have converted to a "record any time
> any channel" and activated.
>
>> The programs are actually coming from the backend in the order you want,
>> before being sorted by the bindings,
> Heh.  Thanks.  I guess I was not looking at the order before sorting too
> terribly closely.
>
>> ------
>> import MythTV
>> class MythBE( MythTV.MythBE ):
>>      @MythTV.MythBE._ProgramQuery("QUERY_GETALLPENDING", header_length=1,
>> sorted=False, recstatus=MythTV.Program.rsInactive)
>>      def getPremiers(self, prog):
>>          if prog.recordid == 1234:
>>              return prog
>>
>> for prog in MythBE().getPremiers():
>>      print u"{0.callsign:<8} {0.title:<40} {0.subtitle:<30}
>> {0.starttime}".format(prog)
>> ------
> Yeah, that's still including the programs that have been set to record
> from the "pilots and premiers" power search rule.  I guess there needs
> to be some kind of further filter to eliminate programs that will
> actually record.  Is that a QUERY_GETALLSCHEDULED?  i.e. in
> QUERY_GETALLPENDING but not in QUERY_GETALLSCHEDULED?
>
> This seems to work:
>
> ------
> import MythTV
> sched_progs = []
> for p in MythTV.MythBE().getScheduledRecordings():
>      sched_progs.append(p.title)
>
> for prog in MythTV.MythBE().getPendingRecordings():
>       if prog.recordid == 521 and not prog.title in sched_progs:
>           print u"{0.callsign:<8} {0.title:<40} {0.subtitle:<30}
> {0.starttime}".format(prog) ------
>
> Is that the right/best way to do that?  Do I need to "stash" the
> list of program titles that are already scheduled to recorded or
> is there a better way?
>
> Ahhh.  But it's probably not "upcoming recordings" I want to
> filter with but rather recording rules regardless of whether they
> actually cause something to be scheduled or not (i.e. it might
> not be showing in the next two weeks).  Not sure where that is
> in these bindings.  Retrieving recording rules seems to always
> be based on matching things that record as a result of them and
> not just rules in general.

It sounds like you're doing this backwards from the way the code I 
suggested was meant to be used.  You have an active rule from which 
you're deactivating recordings versus an inactive rule from which you 
create new (different) rules to record episodes?

If your rule is inactive, there won't be any active recordings coming 
from it, so nothing to filter.

Mike


More information about the mythtv-dev mailing list