diff --git a/birdnet.conf-defaults b/birdnet.conf-defaults index 03ca9f5..58a30fd 100644 --- a/birdnet.conf-defaults +++ b/birdnet.conf-defaults @@ -78,6 +78,7 @@ APPRISE_WEEKLY_REPORT=1 APPRISE_NOTIFY_NEW_SPECIES_EACH_DAY=0 APPRISE_MINIMUM_SECONDS_BETWEEN_NOTIFICATIONS_PER_SPECIES=0 APPRISE_ONLY_NOTIFY_SPECIES_NAMES="" +APPRISE_ONLY_NOTIFY_SPECIES_NAMES_2="" #---------------------- Flickr Images API Configuration -----------------------# ## If FLICKR_API_KEY is set, the web interface will try and display bird images diff --git a/scripts/config.php b/scripts/config.php index 0a1ecf3..0dcdbe5 100644 --- a/scripts/config.php +++ b/scripts/config.php @@ -54,6 +54,7 @@ if(isset($_GET["latitude"])){ $model = $_GET["model"]; $sf_thresh = $_GET["sf_thresh"]; $only_notify_species_names = $_GET['only_notify_species_names']; + $only_notify_species_names_2 = $_GET['only_notify_species_names_2']; if(isset($_GET['apprise_notify_each_detection'])) { $apprise_notify_each_detection = 1; @@ -150,6 +151,7 @@ if(isset($_GET["latitude"])){ $contents = preg_replace("/MODEL=.*/", "MODEL=$model", $contents); $contents = preg_replace("/SF_THRESH=.*/", "SF_THRESH=$sf_thresh", $contents); $contents = preg_replace("/APPRISE_ONLY_NOTIFY_SPECIES_NAMES=.*/", "APPRISE_ONLY_NOTIFY_SPECIES_NAMES=\"$only_notify_species_names\"", $contents); + $contents = preg_replace("/APPRISE_ONLY_NOTIFY_SPECIES_NAMES_2=.*/", "APPRISE_ONLY_NOTIFY_SPECIES_NAMES_2=\"$only_notify_species_names_2\"", $contents); $contents2 = file_get_contents("./scripts/thisrun.txt"); $contents2 = preg_replace("/SITE_NAME=.*/", "SITE_NAME=\"$site_name\"", $contents2); @@ -169,6 +171,7 @@ if(isset($_GET["latitude"])){ $contents2 = preg_replace("/MODEL=.*/", "MODEL=$model", $contents2); $contents2 = preg_replace("/SF_THRESH=.*/", "SF_THRESH=$sf_thresh", $contents2); $contents2 = preg_replace("/APPRISE_ONLY_NOTIFY_SPECIES_NAMES=.*/", "APPRISE_ONLY_NOTIFY_SPECIES_NAMES=\"$only_notify_species_names\"", $contents2); + $contents2 = preg_replace("/APPRISE_ONLY_NOTIFY_SPECIES_NAMES_2=.*/", "APPRISE_ONLY_NOTIFY_SPECIES_NAMES_2=\"$only_notify_species_names_2\"", $contents2); @@ -550,7 +553,9 @@ https://discordapp.com/api/webhooks/{WebhookID}/{WebhookToken}
-
+
+ +

diff --git a/scripts/install_config.sh b/scripts/install_config.sh index 64d83e3..023c135 100755 --- a/scripts/install_config.sh +++ b/scripts/install_config.sh @@ -106,6 +106,7 @@ APPRISE_WEEKLY_REPORT=1 APPRISE_NOTIFY_NEW_SPECIES_EACH_DAY=0 APPRISE_MINIMUM_SECONDS_BETWEEN_NOTIFICATIONS_PER_SPECIES=0 APPRISE_ONLY_NOTIFY_SPECIES_NAMES="" +APPRISE_ONLY_NOTIFY_SPECIES_NAMES_2="" #---------------------- Flickr Images API Configuration -----------------------# ## If FLICKR_API_KEY is set, the web interface will try and display bird images diff --git a/scripts/update_birdnet_snippets.sh b/scripts/update_birdnet_snippets.sh index bc0cc7e..1e88eb9 100755 --- a/scripts/update_birdnet_snippets.sh +++ b/scripts/update_birdnet_snippets.sh @@ -190,6 +190,9 @@ fi if ! grep APPRISE_ONLY_NOTIFY_SPECIES_NAMES /etc/birdnet/birdnet.conf &>/dev/null;then sudo -u$USER echo "APPRISE_ONLY_NOTIFY_SPECIES_NAMES=\"\"" >> /etc/birdnet/birdnet.conf fi +if ! grep APPRISE_ONLY_NOTIFY_SPECIES_NAMES_2 /etc/birdnet/birdnet.conf &>/dev/null;then + sudo -u$USER echo "APPRISE_ONLY_NOTIFY_SPECIES_NAMES_2=\"\"" >> /etc/birdnet/birdnet.conf +fi if ! grep RTSP_STREAM_TO_LIVESTREAM /etc/birdnet/birdnet.conf &>/dev/null;then sudo -u$USER echo "RTSP_STREAM_TO_LIVESTREAM=\"0\"" >> /etc/birdnet/birdnet.conf diff --git a/scripts/utils/notifications.py b/scripts/utils/notifications.py index eaee216..99265a5 100644 --- a/scripts/utils/notifications.py +++ b/scripts/utils/notifications.py @@ -51,6 +51,11 @@ def sendAppriseNotifications(species, confidence, path, date, time, week, latitu if APPRISE_ONLY_NOTIFY_SPECIES_NAMES is not None and APPRISE_ONLY_NOTIFY_SPECIES_NAMES.strip() != "": if any(bird.lower().replace(" ", "") in comName.lower().replace(" ", "") for bird in APPRISE_ONLY_NOTIFY_SPECIES_NAMES.split(",")): return + + APPRISE_ONLY_NOTIFY_SPECIES_NAMES_2 = settings_dict.get('APPRISE_ONLY_NOTIFY_SPECIES_NAMES_2') + if APPRISE_ONLY_NOTIFY_SPECIES_NAMES_2 is not None and APPRISE_ONLY_NOTIFY_SPECIES_NAMES_2.strip() != "": + if not any(bird.lower().replace(" ", "") in comName.lower().replace(" ", "") for bird in APPRISE_ONLY_NOTIFY_SPECIES_NAMES_2.split(",")): + return APPRISE_MINIMUM_SECONDS_BETWEEN_NOTIFICATIONS_PER_SPECIES = settings_dict.get('APPRISE_MINIMUM_SECONDS_BETWEEN_NOTIFICATIONS_PER_SPECIES') if APPRISE_MINIMUM_SECONDS_BETWEEN_NOTIFICATIONS_PER_SPECIES != "0":