Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: MythTV: Users

python Bindings - Get Recorded Programs Sorted by Starttime

 

 

MythTV users RSS feed   Index | Next | Previous | View Threaded


lists at manor-farm

Dec 13, 2010, 12:39 AM

Post #1 of 1 (278 views)
Permalink
python Bindings - Get Recorded Programs Sorted by Starttime

I am gradually converting all my python scripts from "Horrible database
hacks" to using the shiny new bindings. One thing I often want to do is
to get a list of the last n recorded programs. Myth itself allows this
with "QUERY_RECORDINGS Delete". However, unless I have missed something,
which is more than likely, the python bindings don't seem to offer this
function.

It's relatively easy to do it yourself like this:

class MyBackend(MythBE):
"""
Class inherited from MythBE that implements a method
to return recorded programs ordered by start time.
"""
def getSortedRecordings(self):
"""
Returns a list of all Program objects which have already recorded,
sorted by startime
"""
recordings = self._getSortedPrograms('QUERY_RECORDINGS Delete')

# Filter out Live TV.
nolivetv = [program for program in recordings if
program["recgroup"] != "LiveTV"]

return nolivetv

However, it would be nice to have this in the core bindings. If I write
a patch, would it be considered for inclusion?

Ian.
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

MythTV users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.