Skip to content

Commit 94636d7

Browse files
author
Simone Pierazzini
committed
Log date parsing errors
1 parent 25c6190 commit 94636d7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

plexapi/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
from plexapi import compat
1313
from plexapi.exceptions import NotFound
1414

15+
16+
LOG = logging.getLogger(__name__)
17+
18+
1519
# Search Types - Plex uses these to filter specific media types when searching.
1620
# Library Types - Populated at runtime
1721
SEARCHTYPES = {'movie': 1, 'show': 2, 'season': 3, 'episode': 4, 'trailer': 5, 'comic': 6, 'person': 7,
@@ -179,7 +183,7 @@ def toDatetime(value, format=None):
179183
try:
180184
value = datetime.strptime(value, format)
181185
except ValueError:
182-
# parsing failed
186+
LOG.info('Failed to parse %s to datetime, defaulting to None', value)
183187
return None
184188
else:
185189
# https://bugs.python.org/issue30684

0 commit comments

Comments
 (0)