From ac780884e3c2119ede9063468c60db53bb89e52e Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sun, 2 Jun 2024 10:25:41 +0200 Subject: [PATCH] Accept any file extension instead of just mp3 (#82) https://github.com/Nachtzuster/BirdNET-Pi/issues/81 --- scripts/birdnet_changeidentification.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/birdnet_changeidentification.sh b/scripts/birdnet_changeidentification.sh index 3a2a27d..a9a0acc 100755 --- a/scripts/birdnet_changeidentification.sh +++ b/scripts/birdnet_changeidentification.sh @@ -20,7 +20,7 @@ NEWNAME="$2" #NEWNAME="Lapinus atricapilla_Lapinu à tête noire" OUTPUT_TYPE="${3:-debug}" # Set 3rd argument to debug to have all outputs # Ask for user input if no arguments -if [ -z "$OLDNAME" ]; then read -r -p 'OLDNAME (finishing by mp3): ' OLDNAME; fi +if [ -z "$OLDNAME" ]; then read -r -p 'OLDNAME (finishing by file extension): ' OLDNAME; fi if [ -z "$NEWNAME" ]; then read -r -p 'NEWNAME (sciname_commoname): ' NEWNAME; fi # Fixed values @@ -37,8 +37,8 @@ if [ ! -f "$LABELS_FILE" ]; then echo "$LABELS_FILE doesn't exist, exiting" && e if [ ! -f "$DB_FILE" ]; then echo "$DB_FILE doesn't exist, exiting" && exit 1; fi # Check if inputs are valid -if [[ "$1" != *".mp3" ]]; then - echo "The first argument should be a filename starting with the common name of the bird and finishing by mp3!" +if [[ "$1" != *"."* ]]; then + echo "The first argument should be a filename starting with the common name of the bird and finishing by the file extension!" echo "Instead, it is : $1" exit 1 elif [[ "$2" != *"_"* ]]; then