From e6f48f8b613aa7fa1a10910c5e874503a0aa181e Mon Sep 17 00:00:00 2001 From: OliNau <19350388+OliNau@users.noreply.github.com> Date: Sun, 9 Jun 2024 11:16:02 +0200 Subject: [PATCH] Add additional apprise notification option (#88) * Update config.php Added $maskedlistenurl as an option for apprise notifications. * Update notifications.py Make sure $maskedlistenurl also works with default detections, and not only when testing. * Update config.php Changed maskedlistenurl to friendlyurl * Update notifications.py Changed maskedlistenurl to friendlyurl --- scripts/config.php | 6 ++++++ scripts/utils/notifications.py | 2 ++ 2 files changed, 8 insertions(+) diff --git a/scripts/config.php b/scripts/config.php index 215b0c925..ed3117d94 100644 --- a/scripts/config.php +++ b/scripts/config.php @@ -220,6 +220,8 @@ function() { $filename = "http://".$_SERVER['SERVER_NAME']."/"."?filename=".$filename; } + $friendlyfilename = "[Listen here](".$filename.")"; + $attach=""; $exampleimage = "https://live.staticflickr.com/7430/27545810581_8bfa8289a3_c.jpg"; if (strpos($body, '$flickrimage') !== false) { @@ -234,6 +236,7 @@ function() { $title = str_replace("\$confidencepct", round($confidence*100), $title); $title = str_replace("\$confidence", $confidence, $title); $title = str_replace("\$listenurl", $filename, $title); + $title = str_replace("\$friendlyurl", $friendlyfilename, $title); $title = str_replace("\$date", $date, $title); $title = str_replace("\$time", $time, $title); $title = str_replace("\$week", $week, $title); @@ -250,6 +253,7 @@ function() { $body = str_replace("\$confidencepct", round($confidence*100), $body); $body = str_replace("\$confidence", $confidence, $body); $body = str_replace("\$listenurl", $filename, $body); + $body = str_replace("\$friendlyurl", $friendlyfilename, $body); $body = str_replace("\$date", $date, $body); $body = str_replace("\$time", $time, $body); $body = str_replace("\$week", $week, $body); @@ -499,6 +503,8 @@ function runProcess() {