mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-16 02:02:58 -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
|
@ -83,7 +83,8 @@ def available_notification_agents():
|
|||
'on_extup': plexpy.CONFIG.GROWL_ON_EXTUP,
|
||||
'on_intup': plexpy.CONFIG.GROWL_ON_INTUP,
|
||||
'on_pmsupdate': plexpy.CONFIG.GROWL_ON_PMSUPDATE,
|
||||
'on_concurrent': plexpy.CONFIG.GROWL_ON_CONCURRENT
|
||||
'on_concurrent': plexpy.CONFIG.GROWL_ON_CONCURRENT,
|
||||
'on_newdevice': plexpy.CONFIG.GROWL_ON_NEWDEVICE
|
||||
},
|
||||
{'name': 'Prowl',
|
||||
'id': AGENT_IDS['Prowl'],
|
||||
|
@ -102,7 +103,8 @@ def available_notification_agents():
|
|||
'on_extup': plexpy.CONFIG.PROWL_ON_EXTUP,
|
||||
'on_intup': plexpy.CONFIG.PROWL_ON_INTUP,
|
||||
'on_pmsupdate': plexpy.CONFIG.PROWL_ON_PMSUPDATE,
|
||||
'on_concurrent': plexpy.CONFIG.PROWL_ON_CONCURRENT
|
||||
'on_concurrent': plexpy.CONFIG.PROWL_ON_CONCURRENT,
|
||||
'on_newdevice': plexpy.CONFIG.PROWL_ON_NEWDEVICE
|
||||
},
|
||||
{'name': 'XBMC',
|
||||
'id': AGENT_IDS['XBMC'],
|
||||
|
@ -121,7 +123,8 @@ def available_notification_agents():
|
|||
'on_extup': plexpy.CONFIG.XBMC_ON_EXTUP,
|
||||
'on_intup': plexpy.CONFIG.XBMC_ON_INTUP,
|
||||
'on_pmsupdate': plexpy.CONFIG.XBMC_ON_PMSUPDATE,
|
||||
'on_concurrent': plexpy.CONFIG.XBMC_ON_CONCURRENT
|
||||
'on_concurrent': plexpy.CONFIG.XBMC_ON_CONCURRENT,
|
||||
'on_newdevice': plexpy.CONFIG.XBMC_ON_NEWDEVICE
|
||||
},
|
||||
{'name': 'Plex Home Theater',
|
||||
'id': AGENT_IDS['Plex'],
|
||||
|
@ -140,7 +143,8 @@ def available_notification_agents():
|
|||
'on_extup': plexpy.CONFIG.PLEX_ON_EXTUP,
|
||||
'on_intup': plexpy.CONFIG.PLEX_ON_INTUP,
|
||||
'on_pmsupdate': plexpy.CONFIG.PLEX_ON_PMSUPDATE,
|
||||
'on_concurrent': plexpy.CONFIG.PLEX_ON_CONCURRENT
|
||||
'on_concurrent': plexpy.CONFIG.PLEX_ON_CONCURRENT,
|
||||
'on_newdevice': plexpy.CONFIG.PLEX_ON_NEWDEVICE
|
||||
},
|
||||
{'name': 'NotifyMyAndroid',
|
||||
'id': AGENT_IDS['NMA'],
|
||||
|
@ -159,7 +163,8 @@ def available_notification_agents():
|
|||
'on_extup': plexpy.CONFIG.NMA_ON_EXTUP,
|
||||
'on_intup': plexpy.CONFIG.NMA_ON_INTUP,
|
||||
'on_pmsupdate': plexpy.CONFIG.NMA_ON_PMSUPDATE,
|
||||
'on_concurrent': plexpy.CONFIG.NMA_ON_CONCURRENT
|
||||
'on_concurrent': plexpy.CONFIG.NMA_ON_CONCURRENT,
|
||||
'on_newdevice': plexpy.CONFIG.NMA_ON_NEWDEVICE
|
||||
},
|
||||
{'name': 'Pushalot',
|
||||
'id': AGENT_IDS['Pushalot'],
|
||||
|
@ -178,7 +183,8 @@ def available_notification_agents():
|
|||
'on_extup': plexpy.CONFIG.PUSHALOT_ON_EXTUP,
|
||||
'on_intup': plexpy.CONFIG.PUSHALOT_ON_INTUP,
|
||||
'on_pmsupdate': plexpy.CONFIG.PUSHALOT_ON_PMSUPDATE,
|
||||
'on_concurrent': plexpy.CONFIG.PUSHALOT_ON_CONCURRENT
|
||||
'on_concurrent': plexpy.CONFIG.PUSHALOT_ON_CONCURRENT,
|
||||
'on_newdevice': plexpy.CONFIG.PUSHALOT_ON_NEWDEVICE
|
||||
},
|
||||
{'name': 'Pushbullet',
|
||||
'id': AGENT_IDS['Pushbullet'],
|
||||
|
@ -197,7 +203,8 @@ def available_notification_agents():
|
|||
'on_extup': plexpy.CONFIG.PUSHBULLET_ON_EXTUP,
|
||||
'on_intup': plexpy.CONFIG.PUSHBULLET_ON_INTUP,
|
||||
'on_pmsupdate': plexpy.CONFIG.PUSHBULLET_ON_PMSUPDATE,
|
||||
'on_concurrent': plexpy.CONFIG.PUSHBULLET_ON_CONCURRENT
|
||||
'on_concurrent': plexpy.CONFIG.PUSHBULLET_ON_CONCURRENT,
|
||||
'on_newdevice': plexpy.CONFIG.PUSHBULLET_ON_NEWDEVICE
|
||||
},
|
||||
{'name': 'Pushover',
|
||||
'id': AGENT_IDS['Pushover'],
|
||||
|
@ -216,7 +223,8 @@ def available_notification_agents():
|
|||
'on_extup': plexpy.CONFIG.PUSHOVER_ON_EXTUP,
|
||||
'on_intup': plexpy.CONFIG.PUSHOVER_ON_INTUP,
|
||||
'on_pmsupdate': plexpy.CONFIG.PUSHOVER_ON_PMSUPDATE,
|
||||
'on_concurrent': plexpy.CONFIG.PUSHOVER_ON_CONCURRENT
|
||||
'on_concurrent': plexpy.CONFIG.PUSHOVER_ON_CONCURRENT,
|
||||
'on_newdevice': plexpy.CONFIG.PUSHOVER_ON_NEWDEVICE
|
||||
},
|
||||
{'name': 'Boxcar2',
|
||||
'id': AGENT_IDS['Boxcar2'],
|
||||
|
@ -235,7 +243,8 @@ def available_notification_agents():
|
|||
'on_extup': plexpy.CONFIG.BOXCAR_ON_EXTUP,
|
||||
'on_intup': plexpy.CONFIG.BOXCAR_ON_INTUP,
|
||||
'on_pmsupdate': plexpy.CONFIG.BOXCAR_ON_PMSUPDATE,
|
||||
'on_concurrent': plexpy.CONFIG.BOXCAR_ON_CONCURRENT
|
||||
'on_concurrent': plexpy.CONFIG.BOXCAR_ON_CONCURRENT,
|
||||
'on_newdevice': plexpy.CONFIG.BOXCAR_ON_NEWDEVICE
|
||||
},
|
||||
{'name': 'E-mail',
|
||||
'id': AGENT_IDS['Email'],
|
||||
|
@ -254,7 +263,8 @@ def available_notification_agents():
|
|||
'on_extup': plexpy.CONFIG.EMAIL_ON_EXTUP,
|
||||
'on_intup': plexpy.CONFIG.EMAIL_ON_INTUP,
|
||||
'on_pmsupdate': plexpy.CONFIG.EMAIL_ON_PMSUPDATE,
|
||||
'on_concurrent': plexpy.CONFIG.EMAIL_ON_CONCURRENT
|
||||
'on_concurrent': plexpy.CONFIG.EMAIL_ON_CONCURRENT,
|
||||
'on_newdevice': plexpy.CONFIG.EMAIL_ON_NEWDEVICE
|
||||
},
|
||||
{'name': 'Twitter',
|
||||
'id': AGENT_IDS['Twitter'],
|
||||
|
@ -273,7 +283,8 @@ def available_notification_agents():
|
|||
'on_extup': plexpy.CONFIG.TWITTER_ON_EXTUP,
|
||||
'on_intup': plexpy.CONFIG.TWITTER_ON_INTUP,
|
||||
'on_pmsupdate': plexpy.CONFIG.TWITTER_ON_PMSUPDATE,
|
||||
'on_concurrent': plexpy.CONFIG.TWITTER_ON_CONCURRENT
|
||||
'on_concurrent': plexpy.CONFIG.TWITTER_ON_CONCURRENT,
|
||||
'on_newdevice': plexpy.CONFIG.TWITTER_ON_NEWDEVICE
|
||||
},
|
||||
{'name': 'IFTTT',
|
||||
'id': AGENT_IDS['IFTTT'],
|
||||
|
@ -292,7 +303,8 @@ def available_notification_agents():
|
|||
'on_extup': plexpy.CONFIG.IFTTT_ON_EXTUP,
|
||||
'on_intup': plexpy.CONFIG.IFTTT_ON_INTUP,
|
||||
'on_pmsupdate': plexpy.CONFIG.IFTTT_ON_PMSUPDATE,
|
||||
'on_concurrent': plexpy.CONFIG.IFTTT_ON_CONCURRENT
|
||||
'on_concurrent': plexpy.CONFIG.IFTTT_ON_CONCURRENT,
|
||||
'on_newdevice': plexpy.CONFIG.IFTTT_ON_NEWDEVICE
|
||||
},
|
||||
{'name': 'Telegram',
|
||||
'id': AGENT_IDS['Telegram'],
|
||||
|
@ -311,7 +323,8 @@ def available_notification_agents():
|
|||
'on_extup': plexpy.CONFIG.TELEGRAM_ON_EXTUP,
|
||||
'on_intup': plexpy.CONFIG.TELEGRAM_ON_INTUP,
|
||||
'on_pmsupdate': plexpy.CONFIG.TELEGRAM_ON_PMSUPDATE,
|
||||
'on_concurrent': plexpy.CONFIG.TELEGRAM_ON_CONCURRENT
|
||||
'on_concurrent': plexpy.CONFIG.TELEGRAM_ON_CONCURRENT,
|
||||
'on_newdevice': plexpy.CONFIG.TELEGRAM_ON_NEWDEVICE
|
||||
},
|
||||
{'name': 'Slack',
|
||||
'id': AGENT_IDS['Slack'],
|
||||
|
@ -330,7 +343,8 @@ def available_notification_agents():
|
|||
'on_extup': plexpy.CONFIG.SLACK_ON_EXTUP,
|
||||
'on_intup': plexpy.CONFIG.SLACK_ON_INTUP,
|
||||
'on_pmsupdate': plexpy.CONFIG.SLACK_ON_PMSUPDATE,
|
||||
'on_concurrent': plexpy.CONFIG.SLACK_ON_CONCURRENT
|
||||
'on_concurrent': plexpy.CONFIG.SLACK_ON_CONCURRENT,
|
||||
'on_newdevice': plexpy.CONFIG.SLACK_ON_NEWDEVICE
|
||||
},
|
||||
{'name': 'Scripts',
|
||||
'id': AGENT_IDS['Scripts'],
|
||||
|
@ -349,7 +363,8 @@ def available_notification_agents():
|
|||
'on_intdown': plexpy.CONFIG.SCRIPTS_ON_INTDOWN,
|
||||
'on_intup': plexpy.CONFIG.SCRIPTS_ON_INTUP,
|
||||
'on_pmsupdate': plexpy.CONFIG.SCRIPTS_ON_PMSUPDATE,
|
||||
'on_concurrent': plexpy.CONFIG.SCRIPTS_ON_CONCURRENT
|
||||
'on_concurrent': plexpy.CONFIG.SCRIPTS_ON_CONCURRENT,
|
||||
'on_newdevice': plexpy.CONFIG.SCRIPTS_ON_NEWDEVICE
|
||||
},
|
||||
{'name': 'Facebook',
|
||||
'id': AGENT_IDS['Facebook'],
|
||||
|
@ -368,7 +383,8 @@ def available_notification_agents():
|
|||
'on_extup': plexpy.CONFIG.FACEBOOK_ON_EXTUP,
|
||||
'on_intup': plexpy.CONFIG.FACEBOOK_ON_INTUP,
|
||||
'on_pmsupdate': plexpy.CONFIG.FACEBOOK_ON_PMSUPDATE,
|
||||
'on_concurrent': plexpy.CONFIG.FACEBOOK_ON_CONCURRENT
|
||||
'on_concurrent': plexpy.CONFIG.FACEBOOK_ON_CONCURRENT,
|
||||
'on_newdevice': plexpy.CONFIG.FACEBOOK_ON_NEWDEVICE
|
||||
},
|
||||
{'name': 'Browser',
|
||||
'id': AGENT_IDS['Browser'],
|
||||
|
@ -387,7 +403,8 @@ def available_notification_agents():
|
|||
'on_extup': plexpy.CONFIG.BROWSER_ON_EXTUP,
|
||||
'on_intup': plexpy.CONFIG.BROWSER_ON_INTUP,
|
||||
'on_pmsupdate': plexpy.CONFIG.BROWSER_ON_PMSUPDATE,
|
||||
'on_concurrent': plexpy.CONFIG.BROWSER_ON_CONCURRENT
|
||||
'on_concurrent': plexpy.CONFIG.BROWSER_ON_CONCURRENT,
|
||||
'on_newdevice': plexpy.CONFIG.BROWSER_ON_NEWDEVICE
|
||||
},
|
||||
{'name': 'Join',
|
||||
'id': AGENT_IDS['Join'],
|
||||
|
@ -406,7 +423,8 @@ def available_notification_agents():
|
|||
'on_extup': plexpy.CONFIG.JOIN_ON_EXTUP,
|
||||
'on_intup': plexpy.CONFIG.JOIN_ON_INTUP,
|
||||
'on_pmsupdate': plexpy.CONFIG.JOIN_ON_PMSUPDATE,
|
||||
'on_concurrent': plexpy.CONFIG.JOIN_ON_CONCURRENT
|
||||
'on_concurrent': plexpy.CONFIG.JOIN_ON_CONCURRENT,
|
||||
'on_newdevice': plexpy.CONFIG.JOIN_ON_NEWDEVICE
|
||||
}
|
||||
]
|
||||
|
||||
|
@ -430,7 +448,8 @@ def available_notification_agents():
|
|||
'on_extup': plexpy.CONFIG.OSX_NOTIFY_ON_EXTUP,
|
||||
'on_intup': plexpy.CONFIG.OSX_NOTIFY_ON_INTUP,
|
||||
'on_pmsupdate': plexpy.CONFIG.OSX_NOTIFY_ON_PMSUPDATE,
|
||||
'on_concurrent': plexpy.CONFIG.OSX_NOTIFY_ON_CONCURRENT
|
||||
'on_concurrent': plexpy.CONFIG.OSX_NOTIFY_ON_CONCURRENT,
|
||||
'on_newdevice': plexpy.CONFIG.OSX_NOTIFY_ON_NEWDEVICE
|
||||
})
|
||||
|
||||
return agents
|
||||
|
@ -2112,6 +2131,9 @@ class Scripts(object):
|
|||
elif notify_action == 'concurrent':
|
||||
script = plexpy.CONFIG.SCRIPTS_ON_CONCURRENT_SCRIPT
|
||||
|
||||
elif notify_action == 'newdevice':
|
||||
script = plexpy.CONFIG.SCRIPTS_ON_NEWDEVICE_SCRIPT
|
||||
|
||||
else:
|
||||
# For manual scripts
|
||||
script = kwargs.get('script', '')
|
||||
|
@ -2295,6 +2317,13 @@ class Scripts(object):
|
|||
'description': 'Choose the script for user concurrent streams.',
|
||||
'input_type': 'select',
|
||||
'select_options': self.list_scripts()
|
||||
},
|
||||
{'label': 'User New Device',
|
||||
'value': plexpy.CONFIG.SCRIPTS_ON_NEWDEVICE_SCRIPT,
|
||||
'name': 'scripts_on_newdevice_script',
|
||||
'description': 'Choose the script for user new device.',
|
||||
'input_type': 'select',
|
||||
'select_options': self.list_scripts()
|
||||
}
|
||||
]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue