[mythtv-users] Force refresh of recordings list?

Raymond Wagner raymond at wagnerrp.com
Fri Apr 15 15:04:08 UTC 2011


On 4/15/2011 09:05, Mike Holden wrote:
> I have a script which manually updates the recording group on
> recorded programs depending on certain criteria. It does this by
> directly accessing the database to update the recgroup column in the
> recording table, via a php script.
>
> This brings me to a couple of questions.
>
> 1. Is there a better way to do this, via either the perl or python
> mythtv bindings? I appreciate that direct database updates are
> frowned upon and I would prefer to do it the proper way if possible!
> I've checked the wiki and can't see any api for updating the
> recgroup for a recording.

import MythTV
#either this
rec = MythTV.Recorded((<chanid>, <starttime>))
# or
db = MythTV.MythDB()
rec = db.searchRecorded(multiple=<someval>, search=<someval>, 
criteria=<someval>)
#followed by
rec.update(recgroup="your new group")

> 2. The problem I have with 1. above is that once the recgroup is
> updated, the frontend doesn't automatically see the changes. I would
> like to send some kind of "recordings refresh" command to all
> frontends to tell it to refresh it's list of recordings. Is this
> possible? Again, I've searched the wiki and can't see anything that
> looks relevant.

be = MythTV.MythBE()
prog = Program.fromRecorded(rec)
be.backendCommand(MythTV.static.BACKEND_SEP.join("MESSAGE", 
"RECORDING_LIST_CHANGE UPDATE", prog.toString))


More information about the mythtv-users mailing list