Fix KeyError due to malformed PMS messages

- Fixes #604
This commit is contained in:
croneter 2019-01-13 17:57:48 +01:00
parent 5cd5b81198
commit 4d17a9747f

View file

@ -154,7 +154,12 @@ def store_timeline_message(data):
# (DVR ratingKeys are not unique and might correspond to a # (DVR ratingKeys are not unique and might correspond to a
# movie or episode) # movie or episode)
continue continue
try:
typus = v.PLEX_TYPE_FROM_WEBSOCKET[int(message['type'])] typus = v.PLEX_TYPE_FROM_WEBSOCKET[int(message['type'])]
except KeyError:
# E.g. -1 - thanks Plex!
LOG.info('Ignoring invalid message %s', data)
continue
if typus in (v.PLEX_TYPE_CLIP, v.PLEX_TYPE_SET): if typus in (v.PLEX_TYPE_CLIP, v.PLEX_TYPE_SET):
# No need to process extras or trailers # No need to process extras or trailers
continue continue