[mythtv-users] Python bindings and timezones
Raymond Wagner
raymond at wagnerrp.com
Sun Oct 6 16:10:23 UTC 2013
On 10/6/2013 11:27 AM, Keith Edmunds wrote:
> 0.26.1+fixes20130919
>
> I have a script that transcodes recorded (radio) programs to mp3, then
> deletes them. The delete part is failing on 0.26, and it seems to be
> because DST (or, here, British Summer Time) isn't being handled correctly.
>
> My transcode user job is passed the %STARTTIME% parameter (amongst
> others), and in the past this worked:
>
> --------------------------------------------------------------------------------
> def main():
> channid = sys.argv[1]
> starttime = sys.argv[2]
>
> be = MythTV.MythBE()
>
> t.log(0, "channid=%s,starttime=%s" % (channid, starttime))
> rec = be.getRecording(channid, starttime)
> --------------------------------------------------------------------------------
>
> rec is always None because the %STARTTIME% parameter is local (DST) time,
> but the database has UTC time.
>
> This seems like a bug (it worked in earlier versions). I could fix it by
> checking to see whether DST is in effect, but given that %STARTTIME% comes
> from Myth, and the code extract above is using the Myth Python bindings, I
> believe it should just work.
If you're running this as a user job, you can supply the %JOBID%, and
use the Job class to interface with that table, pulling the information
from there rather than the command line. It also means you can manually
update the status and comment for the job, for projected completion or
errors.
More information about the mythtv-users
mailing list