# read more about basefile in man parallel
if [ -f $HOME/.flactomp3v2.conf ]
then
- BASEFILE="--bf $HOME/.flactomp3v2.conf --cleanup"
+ BASEFILE="--basefile $HOME/.flactomp3v2.conf --cleanup"
fi
# read parameters
printf "\nPhase %02d of %02d: create symlinks of flac's to working directory %s\n" $((curphase++)) $phase "$work"
for i in $(cat "$albumlist")
do
- cp -rs $musicpath/$i $work/
+ cp --recursive --symbolic-link $musicpath/$i $work/
done
addInfo "<p>"
# convert flac to mp3
# it is the longest phase
printf "\nPhase %02d of %02d: flac -> mp3\n" $((curphase++)) $phase
-find $work -name '*.flac' | sort | parallel $BASEFILE --eta --progress --noswap -S $parallelopts $scriptpath/flactomp3v2.sh {}
+find $work -name '*.flac' | sort | parallel $BASEFILE --eta --progress --noswap --sshlogin $parallelopts $scriptpath/flactomp3v2.sh {}
currentDate
addInfo "flac -> mp3 finished</p>"
addInfo "copy from $work to $dest start<br>"
if [ ! -d $dest ]
then
- mkdir -p $dest
+ mkdir --parents $dest
fi
cp -r $work/* $dest
currentDate
if ( [ $mkzip == true ] || [ $cptodest == true ] ) && [ $removework == true ]
then
printf "cleanup working directory\n\n"
- rm -r $work
+ rm --recursive $work
fi
addInfo "<p>"
RAP=$(metaflac "$INPUTFILE" --show-tag=REPLAYGAIN_ALBUM_PEAK | sed s/.*=//g)
# ID3v2.3 tagging with cover and without cover
-eyed3Command="eyeD3 -2 --to-v2.3 \
--a \"$ARTIST\" -t \"$TITLE\" -A \"$ALBUM\" -G \"${GENRE:-12}\" \
--n \"${TRACKNUMBER:-0}\" -Y \"$DATE\" \
+eyed3Command="eyeD3 --v2 --to-v2.3 \
+--artist=\"$ARTIST\" --title=\"$TITLE\" --album=\"$ALBUM\" --genre=\"${GENRE:-12}\" \
+--track=\"${TRACKNUMBER:-0}\" --year=\"$DATE\" \
--set-user-text-frame=\"REPLAYGAIN_REFERENCE_LOUDNESS:$RRL\" \
--set-user-text-frame=\"REPLAYGAIN_TRACK_GAIN:$RTG\" \
--set-user-text-frame=\"REPLAYGAIN_TRACK_PEAK:$RTP\" \
\"$OUTPUTFILE\" > /dev/null 2>&1"
# stream flac into the lame encoder
-nice -n2 flac -s -c -d "$INPUTFILE" | nice -n3 lame --silent -b $BITRATE -m $MODE --noreplaygain - "$OUTPUTFILE"
+nice --adjustment=2 flac --silent --stdout --decode "$INPUTFILE" | nice --adjustment=3 lame --silent -b $BITRATE -m $MODE --noreplaygain - "$OUTPUTFILE"
eval $eyed3Command
exit 0