From 756f533e7012da68b9213abf6f505eece984171c Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Tue, 29 Sep 2026 20:31:43 +0200 Subject: [PATCH] change allowed extentions for checksum --- src/albentohandy | 12 ++++++++++-- src/albentohandy.conf | 3 ++- 2 files changed, 12 insertions(+), 3 deletions(-) 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 -- 2.47.3