Add triggerword support for completed runs

This commit is contained in:
2022-07-07 21:09:22 +00:00
parent 00dd050151
commit 8201535b5b
4 changed files with 8 additions and 1 deletions

View File

@ -205,7 +205,7 @@ def read_config():
)
# Get the Notifications configuration
for key in ["enabled", "uri", "action", "icons", "body"]:
for key in ["enabled", "uri", "action", "icons", "body", "completed_triggerword"]:
try:
config[f"notifications_{key}"] = o_notifications[key]
except Exception:

View File

@ -38,6 +38,9 @@ def send_webhook(config, status, message):
logger.debug(f"Sending notification to {config['notifications_uri']}")
if status == "completed" and config["notifications_completed_triggerword"]:
message = f"{message} {config['notifications_completed_triggerword']}"
# Get the body data
body = config['notifications_body']
formatted_body = dict()