diff --git a/src/cmd_import_images b/src/cmd_import_images index 9ee960c..06b0be0 100644 --- a/src/cmd_import_images +++ b/src/cmd_import_images @@ -28,7 +28,7 @@ cmd_import_images() { for cue in ${cueList[@]}; do _msg EXEC "Consolidating ${cue}" for var in IMG CUE ACCURIP LOG COVER; do unset ${var}; done - for ext in flac cue accurip log jpg; do + for ext in flac cue accurip log; do local file=$(sed "s|cue|${ext}|" <<< ${cue}) [[ ! -f "${file}" ]] && continue case ${ext} in @@ -42,9 +42,11 @@ cmd_import_images() { (accurip) local ACCURIP="${file}" ;; (log) local LOG="${file}" ;; - (jpg) local COVER="${file}" ;; esac done + + local coverList=($(find $(dirname ${cue}) -mindepth 1 -maxdepth 1 -name '*.jpg' -o -name '*.png')) + local COVER="${coverList}" import_images "${GIT_DIR}" "${SOURCE}" "${IMG}" "${CUE}" $([[ -n "${ACCURIP}" ]] && echo "-a") "${ACCURIP}" $([[ -n "${LOG}" ]] && echo "-l") "${LOG}" $([[ -n "${COVER}" ]] && echo "-c") "${COVER}" >${STDERR} 2>&1 local EXIT=$? [[ ${EXIT} -eq 0 ]] && _msg OK || _msg WARN "Import_images exited with code ${EXIT}" diff --git a/src/import_src b/src/import_src index f3647fb..3a8b368 100644 --- a/src/import_src +++ b/src/import_src @@ -30,14 +30,14 @@ import_src() { echo "Processing audio files" case ${SOURCE} in FLAC) - chk_integrity ${fileList[@]} >${STDERR} 2>&1 + med_integrity ${fileList[@]} >${STDERR} 2>&1 [[ $? -eq 0 ]] || return 4 gen_image "${TRACK_DIR}/flac" $(printf "%s\t" ${fileList[@]}) local EXIT="$?" [[ $? -eq 0 ]] || return 3 ;; CUETOOLS|EAC) - chk_integrity "${TRACK_DIR}/flac" >${STDERR} 2>&1 + med_integrity "${TRACK_DIR}/flac" >${STDERR} 2>&1 [[ $? -eq 0 ]] || return 4 ;; esac