]> gitweb.hhaalo.de Git - albentohandy.git/commitdiff
change cover var to local
authorBastian Dehn <hhaalo@arcor.de>
Sun, 23 Aug 2026 06:25:32 +0000 (08:25 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Sun, 23 Aug 2026 06:25:32 +0000 (08:25 +0200)
albentohandy

index 9124bc65e761cf6bfc1f6d454fd80f0898f47d54..8fdb4dd6a0911984f8c7e74b03966e92b051d53f 100755 (executable)
@@ -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 "$@"