From: Bastian Dehn Date: Sun, 23 Aug 2026 06:25:32 +0000 (+0200) Subject: change cover var to local X-Git-Tag: v1.0.0^2~29 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=0f6b6ed59fd876e17971cde3f96f770e48d77d5c;p=albentohandy.git change cover var to local --- 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 "$@"