mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 15:56:07 -07:00
Add notifier text preview
This commit is contained in:
parent
cb5252b8d4
commit
d874697eef
6 changed files with 91 additions and 4 deletions
|
@ -557,7 +557,7 @@ def build_server_notify_params(notify_action=None, **kwargs):
|
|||
return available_params
|
||||
|
||||
|
||||
def build_notify_text(subject='', body='', notify_action=None, parameters=None, agent_id=None):
|
||||
def build_notify_text(subject='', body='', notify_action=None, parameters=None, agent_id=None, test=False):
|
||||
media_type = parameters.get('media_type')
|
||||
|
||||
all_tags = r'<movie>.*?</movie>|' \
|
||||
|
@ -596,8 +596,13 @@ def build_notify_text(subject='', body='', notify_action=None, parameters=None,
|
|||
default_body = default_action.get('body', '')
|
||||
|
||||
# Use default subject and body if they are blank
|
||||
subject = subject or default_subject
|
||||
body = body or default_body
|
||||
# only if the notification is not script
|
||||
if agent_id != 15:
|
||||
subject = subject or default_subject
|
||||
body = body or default_body
|
||||
|
||||
if test:
|
||||
return subject, body
|
||||
|
||||
try:
|
||||
subject = unicode(subject).format(**parameters)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue