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

Brian J. Murrell brian at interlinx.bc.ca
Mon Jun 4 11:55:59 UTC 2012


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.

> 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.

Cheers,
b.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://www.mythtv.org/pipermail/mythtv-dev/attachments/20120604/92b7b832/attachment.sig>


More information about the mythtv-dev mailing list