Merge pull request #1572 from croneter/py3-logging

Improve logging for converting Unix timestamps
This commit is contained in:
croneter 2021-08-01 15:45:58 +02:00 committed by GitHub
commit 337b61b20c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,10 +33,11 @@ def unix_date_to_kodi(unix_kodi_time):
"""
try:
return strftime('%Y-%m-%d %H:%M:%S', localtime(float(unix_kodi_time)))
except:
LOG.error('Received an illegal timestamp from Plex: %s. '
except Exception as exception:
LOG.error(exception)
LOG.error('Received an illegal timestamp from Plex: %s, type %s. '
'Using 1970-01-01 12:00:00',
unix_kodi_time)
unix_kodi_time, type(unix_kodi_time))
return '1970-01-01 12:00:00'