From f5af87ef24424683453da8dc29cea3b9ee010ba3 Mon Sep 17 00:00:00 2001 From: ayakael Date: Thu, 27 Dec 2018 13:14:32 -0500 Subject: [PATCH] [cmd_import_images] Fixed uknown chk_integrity function [import_src] Fixed detection of cover image --- src/cmd_import_images | 6 ++++-- src/import_src | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) 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