mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-22 11:43:13 +00:00
Update utils.py
add a proper fix for the issue, TODO make it more fault tolerant
This commit is contained in:
parent
99a8037959
commit
d227437054
1 changed files with 4 additions and 1 deletions
|
@ -180,7 +180,10 @@ def toDatetime(value, format=None):
|
|||
else:
|
||||
# https://bugs.python.org/issue30684
|
||||
# And platform support for before epoch seems to be flaky.
|
||||
value = datetime(1970, 1, 1) + timedelta(milliseconds=int(value))
|
||||
# TODO check for others errors too.
|
||||
if int(value) == 0:
|
||||
value = 86400
|
||||
value = datetime.fromtimestamp(int(value))
|
||||
return value
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue