Check on_watched condition before adding to queue

This commit is contained in:
JonnyWong16
2016-10-03 00:20:41 -07:00
committed by JonnyWong16
parent 7b2a7aff9f
commit 82f4c99025
5 changed files with 48 additions and 36 deletions

View File

@@ -99,7 +99,7 @@ class ActivityProcessor(object):
# Check if any notification agents have notifications enabled
if notify:
values.update({'ip_address': session['ip_address']})
plexpy.NOTIFY_QUEUE.put(notification_handler.add_to_notify_queue(
plexpy.NOTIFY_QUEUE.put(notification_handler.add_to_queue(
stream_data=values, notify_action='on_play'))
# If it's our first write then time stamp it.
@@ -116,9 +116,9 @@ class ActivityProcessor(object):
self.db.upsert('sessions', ip_address, keys)
if notify:
plexpy.NOTIFY_QUEUE.put(notification_handler.add_to_notify_queue(
plexpy.NOTIFY_QUEUE.put(notification_handler.add_to_queue(
stream_data=values, notify_action='on_concurrent'))
plexpy.NOTIFY_QUEUE.put(notification_handler.add_to_notify_queue(
plexpy.NOTIFY_QUEUE.put(notification_handler.add_to_queue(
stream_data=values, notify_action='on_newdevice'))
return True