From 69c508574e5764e691fbd7ca0bfa3c3779b5c2c5 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Sun, 23 Aug 2026 08:17:09 +0200 Subject: [PATCH] refactor call programm --- albentohandy | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/albentohandy b/albentohandy index 4e0aca9..9ef9f0c 100755 --- a/albentohandy +++ b/albentohandy @@ -108,7 +108,8 @@ execute_program() { local lib="$1" local workdir="$2" - local scriptpath=$(dirname $(realpath "$0")) + local scriptpath= + scriptpath=$(dirname "$(realpath "$0")") [ -f "$scriptpath/libs/$lib" ] \ || errlog "file $scriptpath/libs/$lib does not exists" \ @@ -130,20 +131,14 @@ convert_process() || errlog "file albumlist does not exists" \ || return $? - case "$format" in - "mp3") execute_program "mp3.sh" "$workdir" || return $? ;; - "flac") execute_program "flac.sh" "$workdir" || return $? ;; - "opus") execute_program "opus.sh" "$workdir" || return $? ;; - *) execute_program "vorbis.sh" "$workdir" || return $? ;; - esac - - cleanup_cover "$workdir" + execute_program "$format.sh" "$workdir" || return $? + cleanup_cover "$workdir" || return $? [ "$format" != "flac" ] && cleanup_flac "$workdir" } main() { - local format= + local format=${format:="vorbis"} check_programms || return $? load_config || return $? -- 2.47.3