From 63688060e4bbc726f23b929af2c048ce6e0d4af3 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Mon, 29 Apr 2024 13:50:55 +0200 Subject: [PATCH] Correct allaboutbirds --- birdnet-pi/rootfs/etc/cont-init.d/99-run.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/birdnet-pi/rootfs/etc/cont-init.d/99-run.sh b/birdnet-pi/rootfs/etc/cont-init.d/99-run.sh index 4b583e861..7f53f4d40 100755 --- a/birdnet-pi/rootfs/etc/cont-init.d/99-run.sh +++ b/birdnet-pi/rootfs/etc/cont-init.d/99-run.sh @@ -41,7 +41,8 @@ fi || (bashio::log.fatal "Error : $TIMEZONE not found. Here is a list of valid t # Correct language labels export "$(grep "^DATABASE_LANG" /config/birdnet.conf)" echo "... adapting labels according to birdnet.conf file to $DATABASE_LANG" -/."$HOME"/BirdNET-Pi/scripts/install_language_label_nm.sh -l "$DATABASE_LANG" +# Saving default of en +cp "$HOME"/BirdNET-Pi/model/labels.txt "$HOME"/BirdNET-Pi/model/labels.bak # Correcting systemctl echo "... correcting systemctl" @@ -79,4 +80,9 @@ gottyservice="$(pgrep -l "gotty" | awk '{print $NF}' | head -n 1)" echo "... using $gottyservice in phpsysinfo" sed -i "s/,gotty,/,${gottyservice:-gotty},/g" "$HOME"/BirdNET-Pi/templates/phpsysinfo.ini +# Correct allaboutbirds for non-english names +echo "... allow allaboutbirds for non-english names" +sed -i '/$sciname =/a \\t$comnameen = shell_exec("grep \\"$( echo \\"$sciname\\" | sed '\''s/_/ /g'\'')\\" /home/pi/BirdNET-Pi/model/labels.bak | cut -d'\''_'\'' -f2 | sed '\''s/ /_/g'\''");' "$HOME"/BirdNET-Pi/scripts/todays_detections.php +sed -i 's|allaboutbirds.org/guide/