Skip to content

A live bird collage card for your Home Assistant dashboard.

Add Purge Threshold

Christopher Leinbach23f52ae6738e
diff --git a/scripts/advanced.php b/scripts/advanced.php
index 468e4df9..7a077afa 100644
--- a/scripts/advanced.php
+++ b/scripts/advanced.php
@@ -132,8 +132,8 @@ if(isset($_GET['submit'])) {
if (isset($_GET["purge_threshold"])) {
$purge_threshold = $_GET["purge_threshold"];
- if (strcmp($purge_threshold, $config['PURGE_THERSHOLD']) !== 0) {
- $contents = preg_replace("/PURGE_THERSHOLD=.*/", "PURGE_THERSHOLD=$purge_threshold", $contents);
+ if (strcmp($purge_threshold, $config['PURGE_THRESHOLD']) !== 0) {
+ $contents = preg_replace("/PURGE_THRESHOLD=.*/", "PURGE_THRESHOLD=$purge_threshold", $contents);
}
}
@@ -306,9 +306,7 @@ $newconfig = get_config();
<br>
<label for="purge_threshold">Purge Threshold (Disk Used %):</label>
<input name="purge_threshold" type="number" style="width:6em;" min="20" max="99" step="1" value="<?php print($newconfig['PURGE_THRESHOLD']);?>"/>
- </td></tr><tr><td>
- <p>Defines how full the disk should be before the purge operations occur.<br>Note: This variable is still active if Keep is set. This means that the servies will be stopped at the purge threshold.</p>
- </td></tr><tr><td>
+ <p>Defines how full the disk should be before the purge operations occur.<br>Note: This variable is still active if Keep is set. This means that the servies will be stopped at the purge threshold.</p><br>
<label for="max_files_species">Amount of files to keep for each species :</label>
<input name="max_files_species" type="number" style="width:6em;" min="0" step="1" value="<?php print($newconfig['MAX_FILES_SPECIES']);?>"/>
</td></tr><tr><td>
diff --git a/scripts/update_birdnet_snippets.sh b/scripts/update_birdnet_snippets.sh
index acbd4c40..1fd61e95 100755
--- a/scripts/update_birdnet_snippets.sh
+++ b/scripts/update_birdnet_snippets.sh
@@ -101,7 +101,7 @@ if ! grep -E '^COLOR_SCHEME=' /etc/birdnet/birdnet.conf &>/dev/null;then
fi
if ! grep -E '^PURGE_THRESHOLD=' /etc/birdnet/birdnet.conf &>/dev/null;then
- echo "PURGE_THRESHOLD=\"95\"" >> /etc/birdnet/birdnet.conf
+ echo "PURGE_THRESHOLD=95" >> /etc/birdnet/birdnet.conf
fi
if ! grep -E '^MAX_FILES_SPECIES=' /etc/birdnet/birdnet.conf &>/dev/null;then