Skip to content

A live bird collage card for your Home Assistant dashboard.

fixing how birdnet_analysis.service handles corrupt audio files

mcguirepr89a8fb4c79a657
diff --git a/scripts/birdnet_analysis.sh b/scripts/birdnet_analysis.sh
index 141ad826..3edfe2d4 100755
--- a/scripts/birdnet_analysis.sh
+++ b/scripts/birdnet_analysis.sh
@@ -48,7 +48,7 @@ fi
# Takes one argument:
# - {DIRECTORY}
get_files() {
- files=($( find ${1} -maxdepth 1 -name '*wav' \
+ files=($( find ${1} -maxdepth 1 -name '*wav' ! -size 0\
| sort \
| awk -F "/" '{print $NF}' ))
[ -n "${files[1]}" ] && echo "Files loaded"