[mythtv] Undelete Recoding with Python Bindings

Casey McGinty casey.mcginty at gmail.com
Fri May 6 21:32:13 UTC 2016


On Mon, Apr 25, 2016 at 12:41 AM Casey McGinty <casey.mcginty at gmail.com>
wrote:

> I believe I tracked this down to a time conversion bug in the Python API.
>


Raymond W. helped me locate the time conversion logic error in dt.py. In my
case I didn't need the time in local format, so there is a quick way to
monkey patch the Python API bindings to resolve the issue. I hope someone
will find this useful.

# MythTV datetime's (dt.py) custom tzinfo (posixtzinfo) has a bug that can
# corrupt the recording's timestmap in the client. We don't really care about
# local date format, therefore the bug can be fixed by setting all timestamps to
# integers and bypassing and conversion bugs.
from MythTV.altdict import DictData
TIMESTAMP_FIELD_INDEX = 4
DictData._trans[TIMESTAMP_FIELD_INDEX] = int
DictData._inv_trans[TIMESTAMP_FIELD_INDEX] = str


This works on the MythTV Python binding distributed with Ubuntu 14.04
server, but it may need to be adjusted for you local version.

Casey McGinty
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-dev/attachments/20160506/3469e88d/attachment.html>


More information about the mythtv-dev mailing list