[print_meta_cue][gen_metatrac] Does not terminate with newline char ";"
[import_src] Now fills in newline char in between outouts of print_meta* and gen_metatrack when combining the two inteo metadataList
This commit is contained in:
parent
384cad646c
commit
8d7c925676
3 changed files with 11 additions and 10 deletions
|
@ -43,7 +43,7 @@ gen_metatrack() {
|
|||
local DURATION=${durationList[${COUNT}]}
|
||||
local REPLAYGAIN_TRACK_GAIN=${replaygainList[$(( $(( ${COUNT} * 4 )) + 2 ))]}
|
||||
local REPLAYGAIN_TRACK_PEAK=${replaygainList[$(( $(( ${COUNT} * 4 )) + 3 ))]}
|
||||
echo "TRACKID=${TRACKID};DURATION=${DURATION};REPLAYGAIN_ALBUM_GAIN=${REPLAYGAIN_ALBUM_GAIN};REPLAYGAIN_ALBUM_PEAK=${REPLAYGAIN_ALBUM_PEAK};REPLAYGAIN_TRACK_GAIN=${REPLAYGAIN_TRACK_GAIN};REPLAYGAIN_TRACK_PEAK=${REPLAYGAIN_TRACK_PEAK};"
|
||||
echo "TRACKID=${TRACKID};DURATION=${DURATION};REPLAYGAIN_ALBUM_GAIN=${REPLAYGAIN_ALBUM_GAIN};REPLAYGAIN_ALBUM_PEAK=${REPLAYGAIN_ALBUM_PEAK};REPLAYGAIN_TRACK_GAIN=${REPLAYGAIN_TRACK_GAIN};REPLAYGAIN_TRACK_PEAK=${REPLAYGAIN_TRACK_PEAK}"
|
||||
local COUNT=$(( ${COUNT} + 1 ))
|
||||
done
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@ import_src() {
|
|||
local SOURCE=$(sed 's|.*.import/||' <<<${TRACK_DIR}| cut -d/ -f1)
|
||||
local supportedsrcList=(FLAC CUETOOLS EAC)
|
||||
|
||||
echo ${TRACK_DIR}
|
||||
# Checks if source supported
|
||||
if ! _if_array_contains ${SOURCE} ${supportedsrcList[@]}; then return 1; fi
|
||||
[[ ! -d "${TRACK_DIR}" ]] && return 2
|
||||
|
@ -29,8 +28,8 @@ import_src() {
|
|||
# Join trackList
|
||||
echo "Processing audio files "
|
||||
case ${SOURCE} in
|
||||
TRACKS)
|
||||
gen_image "${TRACK_DIR}/flac" ${TRACK_DIR}/cue $(printf "%s\t" ${fileList[@]}) > ${STDERR} 2>&1
|
||||
FLAC)
|
||||
gen_image "${TRACK_DIR}/flac" $(printf "%s\t" ${fileList[@]})
|
||||
local EXIT="$?"
|
||||
[[ $? -eq 0 ]] || return 3
|
||||
;;
|
||||
|
@ -53,7 +52,7 @@ import_src() {
|
|||
local trackmetaList=($(print_meta_flac "${trackList}"))
|
||||
;;
|
||||
CUETOOLS|EAC)
|
||||
local trackList=($(grep TRACK ${TRACK_DIR}/cue | wc -l))
|
||||
local trackList=($(grep -o TRACK ${TRACK_DIR}/cue ))
|
||||
local addmetaList=($(gen_metatrack -c "${TRACK_DIR}/cue" "${TRACK_DIR}/flac" ))
|
||||
local trackmetaList=($(print_meta_cue ${TRACK_DIR}/cue))
|
||||
;;
|
||||
|
@ -61,11 +60,13 @@ import_src() {
|
|||
local COUNT=0
|
||||
|
||||
# Conjoins trackmetaList and addmetaList into metadataList
|
||||
while [[ ${COUNT} -lt ${trackList} ]]; do
|
||||
local metadataList[${COUNT}]="${trackmetaList[${COUNT}]}${addmetaList[${COUNT}]}IMAGEID=${IMAGEID};"
|
||||
while [[ ${COUNT} -lt ${#trackList[@]} ]]; do
|
||||
local metadataList[${COUNT}]="${trackmetaList[${COUNT}]};${addmetaList[${COUNT}]};IMAGEID=${IMAGEID};"
|
||||
local COUNT=$(( ${COUNT} + 1 ))
|
||||
done
|
||||
|
||||
echo ${metadataList[@]}
|
||||
|
||||
# Generate cuesheet
|
||||
echo "Generating cue file"
|
||||
case ${SOURCE} in
|
||||
|
|
|
@ -35,7 +35,7 @@ print_meta_cue() {
|
|||
echo -n "TOTALTRACKS=${#trackmetaList[@]};"
|
||||
echo -n "DISCNUMBER=${DISCNUMBER};"
|
||||
echo -n "TOTALDISCS=${TOTALDISCS};"
|
||||
echo "DISCID=${DISCID};"
|
||||
echo "DISCID=${DISCID}"
|
||||
|
||||
local COUNT=$(( ${COUNT} + 1 ))
|
||||
done
|
||||
|
|
Loading…
Reference in a new issue