Skip to content

Commit d227437

Browse files
authored
Update utils.py
add a proper fix for the issue, TODO make it more fault tolerant
1 parent 99a8037 commit d227437

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

plexapi/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,10 @@ def toDatetime(value, format=None):
180180
else:
181181
# https://bugs.python.org/issue30684
182182
# And platform support for before epoch seems to be flaky.
183-
value = datetime(1970, 1, 1) + timedelta(milliseconds=int(value))
183+
# TODO check for others errors too.
184+
if int(value) == 0:
185+
value = 86400
186+
value = datetime.fromtimestamp(int(value))
184187
return value
185188

186189

0 commit comments

Comments
 (0)