[cmd_import] Optimized delegation
[cmd_import_cueripper] [cmd_import_tracks] Changed names of old functions
This commit is contained in:
parent
9e4e9327b2
commit
3670bb268b
3 changed files with 5 additions and 7 deletions
|
@ -28,8 +28,5 @@ cmd_import() {
|
|||
local GIT_DIR="${2}"; shift 2
|
||||
local dirList=(${@})
|
||||
|
||||
|
||||
[[ "${CMD}" == "cueripper" ]] && import_cueripper ${@}
|
||||
[[ "${CMD}" == "eac" ]] && import_eac ${@}
|
||||
[[ "${CMD}" == "tracks" ]] && import_tracks ${@}
|
||||
eval import_${CMD} "${GIT_DIR}" ${@}
|
||||
}
|
||||
|
|
|
@ -11,12 +11,13 @@
|
|||
# }
|
||||
|
||||
cmd_import_cueripper() {
|
||||
local GIT_DIR="${1}"; shift
|
||||
local dirList=("${@}")
|
||||
|
||||
for dir in ${dirList[@]}; do
|
||||
folderList=($(find "${dir}" -name '*.cue' -printf '%h\n' | awk '!seen[$0]++'))
|
||||
for folder in ${folderList[@]}; do
|
||||
gen "${folder}"
|
||||
import_cueripper "${GIT_DIR}" "${folder}"
|
||||
done
|
||||
done
|
||||
}
|
||||
|
|
|
@ -10,13 +10,13 @@
|
|||
#
|
||||
# }
|
||||
|
||||
cmd_import_tracks {
|
||||
cmd_import_tracks() {
|
||||
local ROOT="${1}"; shift 1
|
||||
local dirList=("${@}")
|
||||
for dir in ${dirList[@]}; do
|
||||
folderList=($(find ${ROOT}/${dir} -name '*cover*' -printf '%h\n' | awk '!seen[$0]++' | sed "s|${ROOT}/||g"))
|
||||
for folder in ${folderList[@]}; do
|
||||
gen ${ROOT} "${folder}"
|
||||
import_tracks ${ROOT} "${folder}"
|
||||
done
|
||||
done
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue