[cmd_import_tracks] Now can have batchid be defined
This commit is contained in:
parent
f2e8994b21
commit
7032a0f00c
1 changed files with 4 additions and 1 deletions
|
@ -14,6 +14,9 @@
|
||||||
|
|
||||||
cmd_import_tracks() {
|
cmd_import_tracks() {
|
||||||
local GIT_DIR="${1}"; shift
|
local GIT_DIR="${1}"; shift
|
||||||
|
case ${1} in
|
||||||
|
(-b) local BATCHID=${2}; shift 2;;
|
||||||
|
esac
|
||||||
local srcList=(${@})
|
local srcList=(${@})
|
||||||
local SOURCE=FLAC
|
local SOURCE=FLAC
|
||||||
|
|
||||||
|
@ -42,7 +45,7 @@ cmd_import_tracks() {
|
||||||
local importList=($(find ${GIT_DIR}/.import/FLAC -mindepth 1 -maxdepth 1 -type d -printf '%p\t'))
|
local importList=($(find ${GIT_DIR}/.import/FLAC -mindepth 1 -maxdepth 1 -type d -printf '%p\t'))
|
||||||
for import in ${importList[@]}; do
|
for import in ${importList[@]}; do
|
||||||
_msg EXEC "Importing ${import}"
|
_msg EXEC "Importing ${import}"
|
||||||
import_src "${GIT_DIR}" "${import}" ${FLAC} >${STDERR} 2>&1
|
import_src "${GIT_DIR}" "${import}" $([[ -n "${BATCHID}" ]] && echo "-b") ${BATCHID} >${STDERR} 2>&1
|
||||||
local EXIT=$?
|
local EXIT=$?
|
||||||
[[ ${EXIT} -eq 0 ]] && _msg OK || { _msg WARN "Importation of ${import} failed, continuing"; continue; }
|
[[ ${EXIT} -eq 0 ]] && _msg OK || { _msg WARN "Importation of ${import} failed, continuing"; continue; }
|
||||||
rm -R ${import} >/dev/null 2>&1
|
rm -R ${import} >/dev/null 2>&1
|
||||||
|
|
Loading…
Reference in a new issue