[import_src] CASE is used instead of IF to treeat sources differently; CUE is now copied rather than generated when treating CUETOOLS and EAC.
This commit is contained in:
parent
388f23ab24
commit
4a7b2c734b
1 changed files with 23 additions and 10 deletions
|
@ -44,21 +44,33 @@ import_src() {
|
||||||
echo "Generating metadata"
|
echo "Generating metadata"
|
||||||
local COUNT=0
|
local COUNT=0
|
||||||
for track in ${trackList[@]}; do
|
for track in ${trackList[@]}; do
|
||||||
if [[ "${SOURCE}" == "FLAC" ]]; then
|
case ${SOURCE} in
|
||||||
local TRACKID=$(metaflac --list --block-number=0 "${track}" | awk 'BEGIN{FS=": "}{if($1==" MD5 signature") {print $2}}')
|
FLAC)
|
||||||
local DURATION=$(soxi -D "${track}")
|
local TRACKID=$(metaflac --list --block-number=0 "${track}" | awk 'BEGIN{FS=": "}{if($1==" MD5 signature") {print $2}}')
|
||||||
local metadata_trackList[${COUNT}]="$(print_meta_flac "${track}");DURATION=${DURATION};IMAGEID=${IMAGEID};TRACKID=${TRACKID};"
|
local DURATION=$(soxi -D "${track}")
|
||||||
elif [[ "${SOURCE}" == "CUETOOLS" ]] || [[ "${SOURCE}" == "EAC" ]]; then
|
local metadata_trackList[${COUNT}]="$(print_meta_flac "${track}");DURATION=${DURATION};IMAGEID=${IMAGEID};TRACKID=${TRACKID};"
|
||||||
local trackmetaList=$(gen_trackmeta "${TRACK_DIR}" "${FLAC}" "${CUE}")
|
;;
|
||||||
local metadata_trackList=($(print_meta_cue "${TRACK_DIR}/cue")${trackmetaList}"IMAGEID=${IMAGEID};")
|
|
||||||
fi
|
CUETOOLS|EAC)
|
||||||
|
local trackmetaList=$(gen_trackmeta "${TRACK_DIR}" "${FLAC}" "${CUE}")
|
||||||
|
local metadata_trackList=($(print_meta_cue "${TRACK_DIR}/cue")${trackmetaList}"IMAGEID=${IMAGEID};")
|
||||||
|
;;
|
||||||
|
esac
|
||||||
local COUNT=$(( ${COUNT} + 1 ))
|
local COUNT=$(( ${COUNT} + 1 ))
|
||||||
done
|
done
|
||||||
|
|
||||||
# Generate cuesheet
|
# Generate cuesheet
|
||||||
echo "Generating cue file"
|
echo "Generating cue file"
|
||||||
gen_cue "${TRACK_DIR}" $(printf '%s\t' ${metadata_trackList[@]}) > "${GIT_DIR}/${IMAGEID}.cue"
|
case ${SOURCE} in
|
||||||
local EXIT=$?
|
FLAC)
|
||||||
|
gen_cue "${TRACK_DIR}" $(printf '%s\t' ${metadata_trackList[@]}) > "${GIT_DIR}/${IMAGEID}.cue"
|
||||||
|
local EXIT=$?
|
||||||
|
;;
|
||||||
|
EAC|CUETOOLS)
|
||||||
|
cat "${TRACK_DIR}/cue" > "${GIT_DIR}/${IMAGEID}.cue"
|
||||||
|
local EXIT=$?
|
||||||
|
;;
|
||||||
|
esac
|
||||||
[[ $? -eq 0 ]] || return 4
|
[[ $? -eq 0 ]] || return 4
|
||||||
add_bom "${GIT_DIR}/${IMAGEID}.cue"
|
add_bom "${GIT_DIR}/${IMAGEID}.cue"
|
||||||
|
|
||||||
|
@ -68,6 +80,7 @@ import_src() {
|
||||||
local EXIT=$?
|
local EXIT=$?
|
||||||
[[ $? -eq 0 ]] || return 5
|
[[ $? -eq 0 ]] || return 5
|
||||||
add_bom "${GIT_DIR}/${IMAGEID}.tags"
|
add_bom "${GIT_DIR}/${IMAGEID}.tags"
|
||||||
|
fix_charset "${GIT_DIR}/${IMAGEID}.tags"
|
||||||
|
|
||||||
|
|
||||||
# Move joined.flac to GIT_DIR
|
# Move joined.flac to GIT_DIR
|
||||||
|
|
Loading…
Reference in a new issue