From: Bastian Dehn Date: Tue, 29 Sep 2026 18:31:43 +0000 (+0200) Subject: change allowed extentions for checksum X-Git-Tag: v1.0.3^2~10 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=756f533e7012da68b9213abf6f505eece984171c;p=albentohandy.git change allowed extentions for checksum --- diff --git a/src/albentohandy b/src/albentohandy index b3912b1..c095ff3 100755 --- a/src/albentohandy +++ b/src/albentohandy @@ -121,9 +121,17 @@ cleanup_flac() calc_checksum() { + [ -n "$EXTENSIONS" ] \ + || [ "${#EXTIONSIONS[@]}" -ne 0 ] \ + || EXTENSIONS=("ogg" "mp3" "opus" "flac") + + regex=".*\(" + regex+=$(printf "\|\.%s" "${EXTENSIONS[@]}") + regex=${regex/\\\|/} + regex+="\)" + cd "$OUTPUT_PATH" || return $? - find . -type f \ - -print0 \ + find . -type f -regex "$regex" -print0 \ | sort --zero-terminated \ | sed --null-data '/checksum/d' \ | xargs --null sha256sum > checksum.sha256 diff --git a/src/albentohandy.conf b/src/albentohandy.conf index edfc8e4..f546afc 100644 --- a/src/albentohandy.conf +++ b/src/albentohandy.conf @@ -4,4 +4,5 @@ MUSIC_PATH="$HOME/Music" # BITRATE="192" # QUALITY="6" # OUTPUT_PATH= -# LIB_PATH= \ No newline at end of file +# LIB_PATH= +# EXTENSIONS=("ogg" "mp3" "opus" "flac") \ No newline at end of file