<div dir="ltr"><div>This is directed primarly at Raymond Wagner, but I&#39;d be happy to hear from others.</div><div><br></div>I am working on a script using the transcode wrapper stub and it kept failing... after much digging I think I discovered a couple of issues.<br><div><br></div><div>Issue 1: When the script is run, either from the commandline or as a job, it uses local time for the &#39;starttime&#39; of the target recording.  However mythcommflag expects starttime to be UTC.</div><div><br></div><div>I was able to solve this by converting starttime to utc for the mythcommflag call.</div><div> - added &#39;datetime&#39; to the from &quot;MythTV import...&quot; </div><div> - in the &quot;if build seektable:&quot; block, I added a new line at the top:</div><div>        utcstarttime = datetime.frommythtime(starttime).mythformat() </div><div>    This works because frommythtime() converts the provided time to utc by default.</div><div>  - replaced &#39;% starttime&#39; with &#39;% utcstarttime&#39; in the task.command block</div><div><br></div><div><br></div><div>Issue 2: mythcommflag is running after the old file is deleted, but before the new filename is committed to the database with the &quot;rec.update&quot; command.  So mythcommflag errors because it cannot find the file.</div><div><br></div><div>I was able to solve this by simply relocating the rec.update() call so it runs just after the rec.basename, rec.filesize, and rec.transcoded values are set.</div><div>  - from what I can tell, when you use rec.basename, rec.filesize, and rec.transcoded, you are simply changing the properties in the rec object, when you do a rec.update you are instructing it to actually commit the values in the object to the corresponding record in the database.  Thus the filename (aka basename) is written to the table where it can be subsequently found by mythcommflag.</div><div><br></div><div><br></div><div>Once I made these changes everything worked, but because I am a bit of a python hack, I wanted to run these changes by the community before committing them to the wiki.  Am I doing anything dumb here.</div></div>