From 8bdaa1bf57f225c3a289ddebebc883345854eaf0 Mon Sep 17 00:00:00 2001 From: ayakael Date: Fri, 18 May 2018 18:06:19 -0700 Subject: [PATCH] [import_dir] [cmd_import_tracks] Finalized functions --- src/cmd_import_tracks | 6 ++++-- src/import_dir | 11 +++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/cmd_import_tracks b/src/cmd_import_tracks index 09c14b4..27e5c22 100644 --- a/src/cmd_import_tracks +++ b/src/cmd_import_tracks @@ -27,7 +27,7 @@ cmd_import_tracks() { for file in ${fileList}; do _msg EXEC "Consolidating ${file}" - import_track "${GIT_DIR}" "${file}" + import_track "${GIT_DIR}" "${file}" >${STDERR} 2>&1 local EXIT=$? [[ ${EXIT} -eq 0 ]] && _msg OK || { _msg WARN "Consolidation of ${file} failed, continuing"; continue; } done @@ -36,9 +36,11 @@ cmd_import_tracks() { local importList=($(find ${GIT_DIR}/.import/ -maxdepth 1 -type d -print '%p\t')) for import in ${importList[@]}; do _msg EXEC "Importing ${import}" - import_dir "${GIT_DIR}" "${import}" + import_dir "${GIT_DIR}" "${import}" >${STDERR} 2>&1 local EXIT=$? [[ ${EXIT} -eq 0 ]] && _msg OK || { _msg WARN "Importation of ${import} failed, continuing"; continue; } done + + } diff --git a/src/import_dir b/src/import_dir index 25364cc..63451f8 100644 --- a/src/import_dir +++ b/src/import_dir @@ -42,8 +42,19 @@ import_dir() { done # Generate cuesheet + _msg EXEC "Generating cue file" gen_cue "${TRACK_DIR}" $(printf '%s\t' ${metadata_trackList[@]}) > "${GIT_DIR}/${IMAGEID}.cue" + local EXIT=$? + [[ $? -eq 0 ]] && _msg OK || { _msg WARN; return 1; } # Generate tags file + _msg EXEC "Generating tags file" gen_mtag $(printf '%s\t' ${metadata_trackList[@]}) > "${GIT_DIR}/${IMAGEID}.tags" + local EXIT=$? + [[ $? -eq 0 ]] && _msg OK || { _msg WARN; return 1; } + + + # Move joined.flac to GIT_DIR + mv "${TARGET_DIR}/joined.flac" "${GIT_DIR}/${IMAGEID}.flac" + return 0 }