mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-10 07:22:37 -07:00
Add notification for user streaming from a new device
This commit is contained in:
parent
f4273cafb6
commit
3ccc82f343
9 changed files with 207 additions and 26 deletions
|
@ -19,6 +19,7 @@ import re
|
|||
|
||||
import plexpy
|
||||
import database
|
||||
import datafactory
|
||||
import libraries
|
||||
import log_reader
|
||||
import logger
|
||||
|
@ -116,6 +117,16 @@ class ActivityProcessor(object):
|
|||
threading.Thread(target=notification_handler.notify,
|
||||
kwargs=dict(stream_data=values, notify_action='concurrent')).start()
|
||||
|
||||
# Check if any notification agents have notifications enabled
|
||||
if notify and any(d['on_newdevice'] for d in notifiers.available_notification_agents()):
|
||||
# Check if any concurrent streams by the user
|
||||
data_factory = datafactory.DataFactory()
|
||||
user_devices = data_factory.get_user_devices(user_id=session['user_id'])
|
||||
if session['machine_id'] not in user_devices:
|
||||
# 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='newdevice')).start()
|
||||
|
||||
return True
|
||||
|
||||
def write_session_history(self, session=None, import_metadata=None, is_import=False, import_ignore_interval=0):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue