[mythtv-users] Automation query
Raymond Wagner
raymond at wagnerrp.com
Sat Feb 12 17:23:00 UTC 2011
On 2/12/2011 12:10, Richard Morton wrote:
> On 12 February 2011 15:08, Ken Bass<kbass at kenbass.com> wrote:
>> What API / techniques are available that would allow me to determine
>> that there are no recording currently being record on ANY/ALL my tuners.
>>
>> Is there a python method to determine this that I can use from a cron job?
>> Would the event system allow this?
> You could install the mythtv-status application; on ubuntu it is in a
> separate package
If hes going to parse the output from mythtv-status, he may as well
forgo it and parse the same XML status page it does directly. See:
http://<yourbackend>:6544/xml
With the Python bindings, there's a couple things you could do from the
MythBE() class. getRecorderList() returns the total number of
recorders, while getFreeRecorderList() returns those that aren't in
use. If they don't match, one of them is in use. You could use
isRecording() directly on the recorder IDs returned by
getRecorderList(), or you could use some other QUERY_RECORDER call. You
could run getRecordings() for a list of all recordings, and a recstatus
of -10 (tuning) or -2 (recording) means a recorder is in use. You could
run getUpcomingRecordings() for a list of shows that will record, and
check their start times to see if any will be in the near future.
More information about the mythtv-users
mailing list