Make sure websocket events are for library items

This commit is contained in:
JonnyWong16 2018-01-15 14:49:49 -08:00
parent 2af5f817a3
commit c5a9ecd4ac

View file

@ -327,6 +327,7 @@ class TimelineHandler(object):
9: 'album',
10: 'track'}
identifier = self.timeline.get('identifier')
state_type = self.timeline.get('state')
media_type = media_types.get(self.timeline.get('type'))
section_id = self.timeline.get('sectionID', 0)
@ -335,6 +336,10 @@ class TimelineHandler(object):
media_state = self.timeline.get('mediaState')
queue_size = self.timeline.get('queueSize')
# Return if it is not a library event (i.e. DVR EPG event)
if identifier != 'com.plexapp.plugins.library':
return
# Add a new media item to the recently added queue
if media_type and section_id > 0 and \
((state_type == 0 and metadata_state == 'created')): # or \