From e1983c4c73a0e98bf2cbb7b0059a7b5ad464f111 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Tue, 15 Jul 2025 18:13:42 +0200 Subject: [PATCH] change flac to lib --- albentohandy | 23 +++++------------------ libs/flac.sh | 12 ++++++++++++ 2 files changed, 17 insertions(+), 18 deletions(-) create mode 100644 libs/flac.sh diff --git a/albentohandy b/albentohandy index de6ca00..70a12e0 100755 --- a/albentohandy +++ b/albentohandy @@ -43,30 +43,17 @@ load_libraries() || return $? [ -f "$BASHLIBS/opus.sh" ] \ || errlog "library opus.sh not found" \ - || return $= + || return $? + [ -f "$BASHLIBS/flac.sh" ] \ + || errlog "library flac.sh not found" \ + || return $? source "$BASHLIBS/voribs.sh" source "$BASHLIBS/mp3.sh" source "$BASHLIBS/opus.sh" + source "$BASHLIBS/flac.sh" } -#### BEGIN FLAC #### - -picture_to_flac() -{ - local workdir="$1" - local flacfiles="$(find $workdir -name '*.flac' | sort)" - - local file= - for file in $flacfiles; do - metaflac \ - --import-picture-from="3|image/jpeg|||${file%/*}/cover.jpg" \ - $file - done -} - -#### END FLAC #### - cleanup_flac() { local workdir="$1" diff --git a/libs/flac.sh b/libs/flac.sh new file mode 100644 index 0000000..f07d0d5 --- /dev/null +++ b/libs/flac.sh @@ -0,0 +1,12 @@ +picture_to_flac() +{ + local workdir="$1" + local flacfiles="$(find $workdir -name '*.flac' | sort)" + + local file= + for file in $flacfiles; do + metaflac \ + --import-picture-from="3|image/jpeg|||${file%/*}/cover.jpg" \ + $file + done +} -- 2.47.3