]> gitweb.hhaalo.de Git - albentohandy.git/commitdiff
fix shellcheck issues mp3.sh
authorBastian Dehn <hhaalo@arcor.de>
Fri, 3 Jul 2026 16:40:37 +0000 (18:40 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Fri, 3 Jul 2026 16:40:37 +0000 (18:40 +0200)
libs/mp3.sh

index b419465d5bd985c805bd3c9aa03c89565730904d..ce69fc9b1cf24fac273c47f90e62c13e82f23ad1 100644 (file)
@@ -1,31 +1,43 @@
+#!/bin/bash
+
 read_flac_to_mp3_tags()
 {
        local inputfile="$1"
        local outputfile="$2"
        local inputfiledir=${inputfile%/*}
+       local ARTIST=
+       local TITLE=
+       local GENRE=
+       local TRACKNUMBER=
+       local DATE=
+       local RRL=
+       local RTG=
+       local RTP=
+       local RAG=
+       local RAP=
 
        # get the tags from flac file
-       local readonly ARTIST=$(metaflac "$inputfile" \
+       ARTIST=$(metaflac "$inputfile" \
                --show-tag=ARTIST | sed s/.*=//g)
-       local readonly TITLE=$(metaflac "$inputfile" \
+       TITLE=$(metaflac "$inputfile" \
                --show-tag=TITLE | sed s/.*=//g)
-       local readonly ALBUM=$(metaflac "$inputfile" \
+       ALBUM=$(metaflac "$inputfile" \
                --show-tag=ALBUM | sed s/.*=//g)
-       local readonly GENRE=$(metaflac "$inputfile" \
+       GENRE=$(metaflac "$inputfile" \
                --show-tag=GENRE | sed s/.*=//g)
-       local readonly TRACKNUMBER=$(metaflac "$inputfile" \
+       TRACKNUMBER=$(metaflac "$inputfile" \
                --show-tag=TRACKNUMBER | sed s/.*=//g)
-       local readonly DATE=$(metaflac "$inputfile" \
+       DATE=$(metaflac "$inputfile" \
                --show-tag=DATE | sed s/.*=//g)
-       local readonly RRL=$(metaflac "$inputfile" \
+       RRL=$(metaflac "$inputfile" \
                --show-tag=REPLAYGAIN_REFERENCE_LOUDNESS | tr '=' ':')
-       local readonly RTG=$(metaflac "$inputfile" \
+       RTG=$(metaflac "$inputfile" \
                --show-tag=REPLAYGAIN_TRACK_GAIN | tr '=' ':')
-       local readonly RTP=$(metaflac "$inputfile" \
+       RTP=$(metaflac "$inputfile" \
                --show-tag=REPLAYGAIN_TRACK_PEAK | tr '=' ':')
-       local readonly RAG=$(metaflac "$inputfile" \
+       RAG=$(metaflac "$inputfile" \
                --show-tag=REPLAYGAIN_ALBUM_GAIN | tr '=' ':')
-       local readonly RAP=$(metaflac "$inputfile" \
+       RAP=$(metaflac "$inputfile" \
                --show-tag=REPLAYGAIN_ALBUM_PEAK | tr '=' ':')
 
        # --------------------------------------------------
@@ -50,8 +62,8 @@ read_flac_to_mp3_tags()
 
 encoding_flac_to_mp3()
 {
-       local readonly inputfile="$1"
-       local readonly outputfile="$2"
+       local inputfile="$1"
+       local outputfile="$2"
 
        nice --adjustment=10 flac --totally-silent --stdout --decode \
                "$inputfile" \
@@ -77,7 +89,7 @@ convert_flac_to_mp3()
        export -f flac_to_mp3
        export -f encoding_flac_to_mp3
        export -f read_flac_to_mp3_tags
-       find $workdir -name '*.flac' \
+       find "$workdir" -name '*.flac' \
                | sort \
                | parallel --will-cite \
                --ungroup \