[import_track] Changed variable TARGET_DIR to TRACK_DIR

This commit is contained in:
ayakael 2018-05-18 17:27:49 -07:00
parent 6e6e177084
commit 1287092bd9
No known key found for this signature in database
GPG key ID: 575626A4AE5F4026

View file

@ -30,16 +30,16 @@ import_track() {
eval local ${metadata} eval local ${metadata}
done done
# Setting TARGET_DIR # Setting TRACK_DIR
[[ -z "${DISCNUMBER}" ]] && local DISCNUMBER=1 [[ -z "${DISCNUMBER}" ]] && local DISCNUMBER=1
local TARGET_DIR="${GIT_DIR}/.import/${ARTIST}--${ALBUM}--$(printf '%02d' ${DISCNUMBER})" local TRACK_DIR="${GIT_DIR}/.import/${ARTIST}--${ALBUM}--$(printf '%02d' ${DISCNUMBER})"
mkdir -p ${TARGET_DIR} mkdir -p ${TRACK_DIR}
[[ ${EXIT} -eq 0 ]] || return 1 [[ ${EXIT} -eq 0 ]] || return 1
# Moving cover to TARGET_DIR # Moving cover to TRACK_DIR
if [[ ${#coverList[@]} -eq 1 ]] && [[ ! -f "${TARGET_DIR}/folder.png" ]]; then if [[ ${#coverList[@]} -eq 1 ]] && [[ ! -f "${TRACK_DIR}/folder.png" ]]; then
convert ${coverList[@]} "${TARGET_DIR}/folder.png" convert ${coverList[@]} "${TRACK_DIR}/folder.png"
fi fi
# Converting to FLAC if need me # Converting to FLAC if need me
@ -52,9 +52,9 @@ import_track() {
local SOURCE="${TRACK_EXT}" local SOURCE="${TRACK_EXT}"
fi fi
# Moving track to TARGET_DIR # Moving track to TRACK_DIR
echo "Moving ${TRACK} to ${TARGET_DIR}" echo "Moving ${TRACK} to ${TRACK_DIR}"
mv "${TRACK}" "${TARGET_DIR}/$(printf %02d ${TRACKNUMBER}).${SOURCE}.flac" mv "${TRACK}" "${TRACK_DIR}/$(printf %02d ${TRACKNUMBER}).${SOURCE}.flac"
local EXIT=$? local EXIT=$?
[[ ${EXIT} -eq 0 ]] && return 0 || return 1 [[ ${EXIT} -eq 0 ]] && return 0 || return 1
} }