Fix ValueError during sync due to missing Plex timestamp
This commit is contained in:
parent
1c25441e99
commit
48b08b4ba4
1 changed files with 6 additions and 2 deletions
|
@ -42,8 +42,12 @@ def plex_date_to_kodi(plex_timestamp):
|
|||
|
||||
Output: Y-m-d h:m:s = 2009-04-05 23:16:04
|
||||
"""
|
||||
return strftime('%Y-%m-%d %H:%M:%S',
|
||||
localtime(float(plex_timestamp) + KODI_PLEX_TIME_OFFSET))
|
||||
try:
|
||||
return strftime('%Y-%m-%d %H:%M:%S',
|
||||
localtime(float(plex_timestamp) + KODI_PLEX_TIME_OFFSET))
|
||||
except ValueError:
|
||||
# the PMS can return -1 as plex_timestamp - great!
|
||||
return strftime('%Y-%m-%d %H:%M:%S', localtime(0))
|
||||
|
||||
|
||||
def kodi_date_to_plex(kodi_timestamp):
|
||||
|
|
Loading…
Reference in a new issue