From 0f6b6ed59fd876e17971cde3f96f770e48d77d5c Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Sun, 23 Aug 2026 08:25:32 +0200 Subject: [PATCH] change cover var to local --- albentohandy | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/albentohandy b/albentohandy index 9124bc6..8fdb4dd 100755 --- a/albentohandy +++ b/albentohandy @@ -44,6 +44,7 @@ cleanup_flac() cleanup_cover() { local workdir="$1" + local cover="$2" [ -n "$workdir" ] \ || errlog "missing workdir could not cleanup" \ @@ -125,6 +126,7 @@ execute_program() convert_process() { local format="$1" + local cover="$2" local workdir="work.$$" [ -f "albumlist" ] \ @@ -132,13 +134,14 @@ convert_process() || return $? execute_program "$format.sh" "$workdir" || return $? - cleanup_cover "$workdir" || return $? + cleanup_cover "$workdir" "$cover" || return $? [ "$format" != "flac" ] && cleanup_flac "$workdir" } main() { local format=${format:="vorbis"} + local cover="false" check_programms || return $? load_config || return $? @@ -147,12 +150,10 @@ main() || errlog "missing MUSICPATH" \ || return $? - cover=false - while getopts "3cfho" optname; do case "$optname" in "3") format="mp3" ;; - "c") cover=true ;; + "c") cover="true" ;; "f") format="flac" ;; "h") usage && return 0 ;; "o") format="opus" ;; @@ -160,7 +161,7 @@ main() esac done - convert_process "$format" || return $$ + convert_process "$format" "$cover" || return $$ } main "$@" -- 2.47.3