From e0d8b867c43af1fc41b495fd5a38c9a0b9a9e5a5 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Sun, 27 Sep 2026 10:12:09 +0200 Subject: [PATCH] change encode with find null terminated --- src/lib/mp3.sh | 5 +++-- src/lib/opus.sh | 5 +++-- src/lib/vorbis.sh | 20 ++++++++++++++------ 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/lib/mp3.sh b/src/lib/mp3.sh index 5baa084..964a4aa 100644 --- a/src/lib/mp3.sh +++ b/src/lib/mp3.sh @@ -114,11 +114,12 @@ mp3_encode_flac() mp3_encode() { local work_path="$1" - find "$work_path" -name '*.flac' \ - | sort \ + find "$work_path" -name '*.flac' -print0 \ + | sort --zero-terminated \ | parallel \ --will-cite \ --ungroup \ + --null \ --eta \ --progress \ mp3_encode_flac {} diff --git a/src/lib/opus.sh b/src/lib/opus.sh index 5846421..061c6bd 100644 --- a/src/lib/opus.sh +++ b/src/lib/opus.sh @@ -39,11 +39,12 @@ opus_encode_flac() opus_encode() { local work_path="$1" - find "$work_path" -name '*.flac' \ - | sort \ + find "$work_path" -name '*.flac' -print0 \ + | sort --zero-terminated \ | parallel \ --will-cite \ --ungroup \ + --null \ --eta \ --progress \ opus_encode_flac {} diff --git a/src/lib/vorbis.sh b/src/lib/vorbis.sh index a93dd72..03f06f6 100644 --- a/src/lib/vorbis.sh +++ b/src/lib/vorbis.sh @@ -104,13 +104,21 @@ vorbis_encode_flac() vorbis_encode() { local work_path="$1" - find "$work_path" -name '*.jpg' \ - | sort \ - | parallel --will-cite --ungroup \ + find "$work_path" -name '*.jpg' -print0 \ + | sort --zero-terminated \ + | parallel \ + --will-cite \ + --ungroup \ + --null \ vorbis_cover_to_metadata {} - find "$work_path" -name '*.flac' \ - | sort \ - | parallel --will-cite --ungroup --eta --progress \ + find "$work_path" -name '*.flac' -print0 \ + | sort --zero-terminated \ + | parallel \ + --will-cite \ + --ungroup \ + --null \ + --eta \ + --progress \ vorbis_encode_flac "{}" } -- 2.47.3