]> gitweb.hhaalo.de Git - albentohandy.git/commitdiff
change allowed extentions for checksum
authorBastian Dehn <hhaalo@arcor.de>
Tue, 29 Sep 2026 18:31:43 +0000 (20:31 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Tue, 29 Sep 2026 18:31:43 +0000 (20:31 +0200)
src/albentohandy
src/albentohandy.conf

index b3912b1b539b38cbfb756dc674564758ad67e7c9..c095ff38606bb5d11320d01435c4a713460a9fa7 100755 (executable)
@@ -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
index edfc8e416a2d61cc64b98e564a71d3a0755d8482..f546afc3e079bbef481b557d59a675cb77322d6f 100644 (file)
@@ -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