[mythtv-users] python Bindings - Get Recorded Programs Sorted by Starttime

Ian Barton lists at manor-farm.org
Mon Dec 13 08:39:25 UTC 2010


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.


More information about the mythtv-users mailing list