Skip to content

A live bird collage card for your Home Assistant dashboard.

fix: deleting detection did not delete the files due to incomplete path

frederik940fc8ef6905
diff --git a/scripts/todays_detections.php b/scripts/todays_detections.php
index 4c117fff..0aaabc0b 100644
--- a/scripts/todays_detections.php
+++ b/scripts/todays_detections.php
@@ -177,13 +177,13 @@ if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" ) {
$searchquery = "";
}
if(isset($_GET['display_limit']) && is_numeric($_GET['display_limit'])){
- $statement0 = $db->prepare('SELECT Time, Com_Name, Sci_Name, Confidence, File_Name FROM detections WHERE Date == Date(\'now\', \'localtime\') '.$searchquery.' ORDER BY Time DESC LIMIT '.(intval($_GET['display_limit'])-40).',40');
+ $statement0 = $db->prepare('SELECT Date, Time, Com_Name, Sci_Name, Confidence, File_Name FROM detections WHERE Date == Date(\'now\', \'localtime\') '.$searchquery.' ORDER BY Time DESC LIMIT '.(intval($_GET['display_limit'])-40).',40');
} else {
// legacy mode
if(isset($_GET['hard_limit']) && is_numeric($_GET['hard_limit'])) {
- $statement0 = $db->prepare('SELECT Time, Com_Name, Sci_Name, Confidence, File_Name FROM detections WHERE Date == Date(\'now\', \'localtime\') '.$searchquery.' ORDER BY Time DESC LIMIT '.$_GET['hard_limit']);
+ $statement0 = $db->prepare('SELECT Date, Time, Com_Name, Sci_Name, Confidence, File_Name FROM detections WHERE Date == Date(\'now\', \'localtime\') '.$searchquery.' ORDER BY Time DESC LIMIT '.$_GET['hard_limit']);
} else {
- $statement0 = $db->prepare('SELECT Time, Com_Name, Sci_Name, Confidence, File_Name FROM detections WHERE Date == Date(\'now\', \'localtime\') '.$searchquery.' ORDER BY Time DESC');
+ $statement0 = $db->prepare('SELECT Date, Time, Com_Name, Sci_Name, Confidence, File_Name FROM detections WHERE Date == Date(\'now\', \'localtime\') '.$searchquery.' ORDER BY Time DESC');
}
}