[mythtv] what backend commands trigger a live tv show to be "recorded" and show in the recorded shows

Chris Pinkham cpinkham at bc2va.org
Mon Jun 11 02:42:27 UTC 2007


* On Sun Jun 10, 2007 at 03:32:18PM -0500, Maclaren, James M  wrote:
> I am trying to add the capability to "record" a live tv show in
> mythroku.  I can watch livetv just fine now, but would like to do the
> equivalent to pressing r in livetv in the front end  for mythroku.
> I have tried passing the backend the message:
> 
> QUERY_RECORDER 3 SET_LIVE_RECORDING 1 (my recorder is 3)
> 
> and the backend replies ok. but the shows don't appear in the recorded list.
> When I watch the backend and press r on my regular frontend the same
> commend is logged by the backend amongst others and it now shows up in
> the recorded shows  Can it be done simply with the backend prootocol?
> If so any advice would be appreciated.

Part of the work is actually done inside mythfrontend inside
TV::ToggleRecord() in libmythtv.

To toggle record ON for a LiveTV program, we do the following:

  - set the recorded.autoexpire column to the default autoexpire
    setting (AutoExpireDefault).
  - set the recorded.recgroup column to 'Default'

To toggle record OFF for a LiveTV program, we do the following:

  - set the recorded.autoexpire column to 10000 (this is a const int in
    libs/libmythtv/tv.h
  - set the recorded.recgroup column to 'LiveTV'

When the AutoExpirer runs every few minutes to expire LiveTV programs,
it looks for recorded.recgroup == 'LiveTV'.  The autoexpirer == 10000
puts these LiveTV programs before any other programs in the expire
list when the expirer runs checking to see if it needs to free up
disk space by deleting recordings.

If you want to verify how we set the autoexpire and recgroup columns, you
can look at libs/libmythtv/programinfo.cpp at the following methods:

  ProgramInfo::SetAutoExpire()
  ProgramInfo::ApplyRecordRecGroupChange()

--
Chris


More information about the mythtv-dev mailing list