From 9a84ed9cfc9a5aaa99baffedd91540c2821de369 Mon Sep 17 00:00:00 2001
From: ehpersonal38 <103586016+ehpersonal38@users.noreply.github.com>
Date: Fri, 6 May 2022 13:30:10 -0400
Subject: [PATCH] Fancy slider
@mcguirepr89 Could you figure out how to not hardcode 166-167? It seems the working path for PHP is "/home/pi/BirdSongs/Extracted", but just a few lines above you use fopen with the apparent working path of "home/pi/BirdNET-Pi", so I'm confused. Thanks in advance.
---
scripts/advanced.php | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/scripts/advanced.php b/scripts/advanced.php
index b3143cf..c71cd24 100644
--- a/scripts/advanced.php
+++ b/scripts/advanced.php
@@ -114,8 +114,6 @@ if(isset($_GET['submit'])) {
if(strcmp($privacy_threshold,$config['PRIVACY_THRESHOLD']) !== 0) {
$contents = preg_replace("/PRIVACY_THRESHOLD=.*/", "PRIVACY_THRESHOLD=$privacy_threshold", $contents);
$contents2 = preg_replace("/PRIVACY_THRESHOLD=.*/", "PRIVACY_THRESHOLD=$privacy_threshold", $contents2);
-
- exec('sudo systemctl restart birdnet_server.service');
}
}
@@ -164,6 +162,15 @@ if(isset($_GET['submit'])) {
fwrite($fh, $contents);
fwrite($fh2, $contents2);
}
+
+$count_included = count(file("/home/pi/BirdNET-Pi/include_species_list.txt"));
+$count_labels = count(file("/home/pi/BirdNET-Pi/model/labels.txt"));
+
+if($count_included > 0) {
+ $count = $count_included;
+} else {
+ $count = $count_labels;
+}
?>