mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-12 08:16:06 -07:00
Fix Script test action
This commit is contained in:
parent
411e798f8e
commit
bb938d4482
2 changed files with 5 additions and 6 deletions
|
@ -179,7 +179,7 @@ def notify(notifier_id=None, notify_action=None, stream_data=None, timeline_data
|
||||||
notifiers.send_notification(notifier_id=notifier_config['id'],
|
notifiers.send_notification(notifier_id=notifier_config['id'],
|
||||||
subject=subject,
|
subject=subject,
|
||||||
body=body,
|
body=body,
|
||||||
action=notify_action.split('on_')[-1],
|
notify_action=notify_action,
|
||||||
parameters=parameters)
|
parameters=parameters)
|
||||||
|
|
||||||
# Set the notification state in the db
|
# Set the notification state in the db
|
||||||
|
|
|
@ -506,14 +506,14 @@ def set_notifier_config(notifier_id=None, agent_id=None, **kwargs):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def send_notification(notifier_id=None, subject='', body='', action='', **kwargs):
|
def send_notification(notifier_id=None, subject='', body='', notify_action='', **kwargs):
|
||||||
notifier_config = get_notifier_config(notifier_id=notifier_id)
|
notifier_config = get_notifier_config(notifier_id=notifier_id)
|
||||||
if notifier_config:
|
if notifier_config:
|
||||||
agent = get_agent_class(agent_id=notifier_config['agent_id'],
|
agent = get_agent_class(agent_id=notifier_config['agent_id'],
|
||||||
config=notifier_config['config'])
|
config=notifier_config['config'])
|
||||||
return agent.notify(subject=subject,
|
return agent.notify(subject=subject,
|
||||||
body=body,
|
body=body,
|
||||||
action=action,
|
action=notify_action.split('on_')[-1],
|
||||||
**kwargs)
|
**kwargs)
|
||||||
else:
|
else:
|
||||||
logger.debug(u"PlexPy Notifiers :: Notification requested but no notifier_id received.")
|
logger.debug(u"PlexPy Notifiers :: Notification requested but no notifier_id received.")
|
||||||
|
@ -2299,7 +2299,6 @@ class SCRIPTS(Notifier):
|
||||||
return
|
return
|
||||||
|
|
||||||
script_args = subject or None
|
script_args = subject or None
|
||||||
action = kwargs.get('action', '')
|
|
||||||
|
|
||||||
logger.debug(u"PlexPy Notifiers :: Trying to run notify script, action: %s, arguments: %s"
|
logger.debug(u"PlexPy Notifiers :: Trying to run notify script, action: %s, arguments: %s"
|
||||||
% (action, script_args))
|
% (action, script_args))
|
||||||
|
@ -2361,14 +2360,14 @@ class SCRIPTS(Notifier):
|
||||||
{'label': 'Script Folder',
|
{'label': 'Script Folder',
|
||||||
'value': self.config['script_folder'],
|
'value': self.config['script_folder'],
|
||||||
'name': 'scripts_script_folder',
|
'name': 'scripts_script_folder',
|
||||||
'description': 'Set your script folder.',
|
'description': 'Enter the full path to your scripts folder.',
|
||||||
'input_type': 'text',
|
'input_type': 'text',
|
||||||
'refresh': True
|
'refresh': True
|
||||||
},
|
},
|
||||||
{'label': 'Script File',
|
{'label': 'Script File',
|
||||||
'value': self.config['script'],
|
'value': self.config['script'],
|
||||||
'name': 'scripts_script',
|
'name': 'scripts_script',
|
||||||
'description': 'Choose the script file.',
|
'description': 'Choose the script file to run.',
|
||||||
'input_type': 'select',
|
'input_type': 'select',
|
||||||
'select_options': self.list_scripts()
|
'select_options': self.list_scripts()
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue