[import_images] Updated to support new version of print_meta_cue

This commit is contained in:
ayakael 2018-07-22 20:15:40 -08:00
parent d164a34aed
commit a26f9cf07d
No known key found for this signature in database
GPG key ID: 575626A4AE5F4026

View file

@ -46,13 +46,15 @@ import_images() {
# Parses cue file for DISCID # Parses cue file for DISCID
local METADATA=$(print_meta_cue "${CUE}") local METADATA=$(print_meta_cue "${CUE}")
local DISCID="$(awk 'BEGIN{FS="=";RS=";"}{if($1=="DISCID"){print $2}}' <<<${METADATA})" local discidList=($(awk 'BEGIN{FS="=";RS=";"}{if($1=="DISCID"){print $2}}' <<<${METADATA} | awk '!seen[$0]++'))
[[ ${#discidList[@]} -ne 1 ]] && return 3
# Copies path to import folder # Copies path to import folder
rm -Rf "${GIT_DIR}/.import/${SOURCE}/${DISCID}" >/dev/null 2>&1 rm -Rf "${GIT_DIR}/.import/${SOURCE}/${discidList}" >/dev/null 2>&1
mkdir -p "${GIT_DIR}/.import/${SOURCE}/${DISCID}" mkdir -p "${GIT_DIR}/.import/${SOURCE}/${discidList}"
for path in ${pathList[@]}; do for path in ${pathList[@]}; do
cp --no-preserve=mode "${path}" "${GIT_DIR}/.import/${SOURCE}/${DISCID}/$(sed 's|.*\.||' <<< ${path})" cp --no-preserve=mode "${path}" "${GIT_DIR}/.import/${SOURCE}/${discidList}/$(sed 's|.*\.||' <<< ${path})"
done done
} }