Return None as timestamp instead of 1970 timestamp
This commit is contained in:
parent
4fbcdcac7f
commit
9682d7a313
1 changed files with 3 additions and 1 deletions
|
@ -41,13 +41,15 @@ def plex_date_to_kodi(plex_timestamp):
|
||||||
propper, human-readable time stamp used by Kodi
|
propper, human-readable time stamp used by Kodi
|
||||||
|
|
||||||
Output: Y-m-d h:m:s = 2009-04-05 23:16:04
|
Output: Y-m-d h:m:s = 2009-04-05 23:16:04
|
||||||
|
|
||||||
|
Returns None if plex_timestamp is not valid (e.g. -1))
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
return strftime('%Y-%m-%d %H:%M:%S',
|
return strftime('%Y-%m-%d %H:%M:%S',
|
||||||
localtime(float(plex_timestamp) + KODI_PLEX_TIME_OFFSET))
|
localtime(float(plex_timestamp) + KODI_PLEX_TIME_OFFSET))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
# the PMS can return -1 as plex_timestamp - great!
|
# the PMS can return -1 as plex_timestamp - great!
|
||||||
return strftime('%Y-%m-%d %H:%M:%S', localtime(0))
|
return
|
||||||
|
|
||||||
|
|
||||||
def kodi_date_to_plex(kodi_timestamp):
|
def kodi_date_to_plex(kodi_timestamp):
|
||||||
|
|
Loading…
Reference in a new issue