Fix the real reason we were getting double start notifications.

This commit is contained in:
Tim
2015-09-23 19:40:22 +02:00
parent b9e900f540
commit 89a03fb263
3 changed files with 6 additions and 4 deletions

View File

@@ -26,7 +26,7 @@ class ActivityProcessor(object):
def __init__(self):
self.db = database.MonitorDatabase()
def write_session(self, session=None):
def write_session(self, session=None, notify=True):
if session:
values = {'session_key': session['session_key'],
'rating_key': session['rating_key'],
@@ -73,8 +73,9 @@ class ActivityProcessor(object):
if result == 'insert':
# Push any notifications - Push it on it's own thread so we don't hold up our db actions
threading.Thread(target=notification_handler.notify,
kwargs=dict(stream_data=values,notify_action='play')).start()
if notify:
threading.Thread(target=notification_handler.notify,
kwargs=dict(stream_data=values, notify_action='play')).start()
started = int(time.time())