[mythtv-users] commflagging and cutlists

Bill Meek keemllib at gmail.com
Mon Jan 20 06:47:48 UTC 2014


On 01/19/2014 02:48 PM, Yan Seiner wrote:
>
> On 01/19/2014 12:35 PM, Michael T. Dean wrote:
>> On 01/18/2014 06:13 PM, Michael Stucky wrote:
>>> On Sat, Jan 18, 2014 at 6:09 PM, Michael Stucky wrote:
>>>
>>>> I'm not sure why you need to look at the database. The actual symbols are
>>>> probably Theme specific, but using the Steppes theme and looking at the
>>>> highlighted recording (Media Library ->  Watch Recordings ->  All Programs ->
>>>> "Program Name") I have a light blue flag indicating that the commflag job
>>>> completed successfully and a darker blue handled scissor indicating that I
>>>> have edited the recording and now have a cutlist.
>>> Never mind.... Needed to read the whole thread! "(ie from a script)" is
>>> why you want to look at the database.
>>
>> Still, using the Python bindings would be much better than looking in the database.
>>
> Agreed, but my python skills are miserably poor as I've discovered. 15 years ago I wrote a distributed DVR in python; then I discovered myth and
> pretty much have not touched python since.

Contest time. I tried to write the shortest python script possible. No error
checking (e.g. if the backend isn't up) and no progress/debug messages. Just
return codes. I can't figure out how to do it without the 'for r in...'.

#!/usr/bin/env python

# To run: somefile.py 2624 2014-01-17T14:00:00Z

# Returns 0 if commflagged is set, 2 if not and 3 if there was no match
# for chanid/starttime. Returns 1 for other errors, e.g. MythDB() fails.

from MythTV import MythDB
import sys

for r in MythDB().searchRecorded(chanid = sys.argv[1], starttime = sys.argv[2]):
     if r.commflagged == 1:
         sys.exit(0)
     else:
         sys.exit(2)

sys.exit(3)

-- 
Bill


More information about the mythtv-users mailing list