mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-08 14:10:52 -07:00
Fix the real reason we were getting double start notifications.
This commit is contained in:
parent
b9e900f540
commit
89a03fb263
3 changed files with 6 additions and 4 deletions
|
@ -51,7 +51,7 @@ class ActivityHandler(object):
|
||||||
def update_db_session(self):
|
def update_db_session(self):
|
||||||
# Update our session temp table values
|
# Update our session temp table values
|
||||||
monitor_proc = activity_processor.ActivityProcessor()
|
monitor_proc = activity_processor.ActivityProcessor()
|
||||||
monitor_proc.write_session(self.get_live_session())
|
monitor_proc.write_session(session=self.get_live_session(), notify=False)
|
||||||
|
|
||||||
def on_start(self):
|
def on_start(self):
|
||||||
if self.is_valid_session():
|
if self.is_valid_session():
|
||||||
|
|
|
@ -26,7 +26,7 @@ class ActivityProcessor(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.db = database.MonitorDatabase()
|
self.db = database.MonitorDatabase()
|
||||||
|
|
||||||
def write_session(self, session=None):
|
def write_session(self, session=None, notify=True):
|
||||||
if session:
|
if session:
|
||||||
values = {'session_key': session['session_key'],
|
values = {'session_key': session['session_key'],
|
||||||
'rating_key': session['rating_key'],
|
'rating_key': session['rating_key'],
|
||||||
|
@ -73,8 +73,9 @@ class ActivityProcessor(object):
|
||||||
|
|
||||||
if result == 'insert':
|
if result == 'insert':
|
||||||
# Push any notifications - Push it on it's own thread so we don't hold up our db actions
|
# Push any notifications - Push it on it's own thread so we don't hold up our db actions
|
||||||
|
if notify:
|
||||||
threading.Thread(target=notification_handler.notify,
|
threading.Thread(target=notification_handler.notify,
|
||||||
kwargs=dict(stream_data=values,notify_action='play')).start()
|
kwargs=dict(stream_data=values, notify_action='play')).start()
|
||||||
|
|
||||||
started = int(time.time())
|
started = int(time.time())
|
||||||
|
|
||||||
|
|
|
@ -1106,6 +1106,7 @@ class OSX_NOTIFY(object):
|
||||||
|
|
||||||
notification_center = NSUserNotificationCenter.defaultUserNotificationCenter()
|
notification_center = NSUserNotificationCenter.defaultUserNotificationCenter()
|
||||||
notification_center.deliverNotification_(notification)
|
notification_center.deliverNotification_(notification)
|
||||||
|
logger.info(u"OSX Notify notifications sent.")
|
||||||
|
|
||||||
del pool
|
del pool
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue