]> gitweb.hhaalo.de Git - albentohandy.git/commitdiff
change flac to lib
authorBastian Dehn <hhaalo@arcor.de>
Tue, 15 Jul 2025 16:13:42 +0000 (18:13 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Tue, 15 Jul 2025 16:13:42 +0000 (18:13 +0200)
albentohandy
libs/flac.sh [new file with mode: 0644]

index de6ca00075125b759d79e06a6205915559c7791c..70a12e0c1bd683533d4e273fef1e1aac2c6c436a 100755 (executable)
@@ -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 (file)
index 0000000..f07d0d5
--- /dev/null
@@ -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
+}