[deploy_gen] Now return 0 instead of 1 when split reattempt is succesful
[deploy_meta] Now uses sed to convert FUTURE_META's semi colon in new line [deploy_mv] Fixed bug where certain syntax in mtag would throw off the trackidList generation [deploy_meta_field] [ and ] characters, which are used for empty fields, are now replaced my space [deploy_meta_mtag] Fixed bug with tagList generation
This commit is contained in:
parent
383139e943
commit
271b515080
5 changed files with 6 additions and 6 deletions
|
@ -25,7 +25,7 @@ deploy_gen() {
|
||||||
# Attempts first split. If fails because of lack of CD quality file, retries with modified breakpointList
|
# Attempts first split. If fails because of lack of CD quality file, retries with modified breakpointList
|
||||||
if ! printf '%s\n' ${breakpointList[@]} | shntool split "${GITDIR}/${IMAGEID}.flac" -o flac -O always -d "${GITDIR}"; then
|
if ! printf '%s\n' ${breakpointList[@]} | shntool split "${GITDIR}/${IMAGEID}.flac" -o flac -O always -d "${GITDIR}"; then
|
||||||
printf '%s\n' ${breakpointList[@]} | sed s/$/0/ | shntool split "${GITDIR}/${IMAGEID}.flac" -o flac -O always -d "${GITDIR}"
|
printf '%s\n' ${breakpointList[@]} | sed s/$/0/ | shntool split "${GITDIR}/${IMAGEID}.flac" -o flac -O always -d "${GITDIR}"
|
||||||
[[ $? -ne 0 ]] && return 2 || return 1
|
[[ $? -ne 0 ]] && return 1 || return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ deploy_meta() {
|
||||||
if [[ "${PRESENT_META}" != "${FUTURE_META}" ]]; then
|
if [[ "${PRESENT_META}" != "${FUTURE_META}" ]]; then
|
||||||
_msg ECHO "${trackid} has differing metadata. Updating"
|
_msg ECHO "${trackid} has differing metadata. Updating"
|
||||||
[[ "${PRESENT_PATH}" == "null" ]] || metaflac --remove-all "${TARGET}/${PRESENT_PATH}"
|
[[ "${PRESENT_PATH}" == "null" ]] || metaflac --remove-all "${TARGET}/${PRESENT_PATH}"
|
||||||
awk 'BEGIN {RS=";"}{print $0}' <<< ${FUTURE_META} | head -n -1 | metaflac --import-tags-from=- --import-picture-from="${GIT_DIR}/${IMAGEID}.jpg" "${TARGET}/${PRESENT_PATH}"
|
sed s'/;/\n/' <<< ${FUTURE_META} | metaflac --import-tags-from=- --import-picture-from="${GIT_DIR}/${IMAGEID}.jpg" "${TARGET}/${PRESENT_PATH}"
|
||||||
[[ $? -eq 0 ]] || local ERR=true
|
[[ $? -eq 0 ]] || local ERR=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ deploy_mv() {
|
||||||
local IMAGEID="${2}"
|
local IMAGEID="${2}"
|
||||||
|
|
||||||
# Generated trackidList to know what id to assign to each file
|
# Generated trackidList to know what id to assign to each file
|
||||||
local trackidList=$(awk 'BEGIN{RS="\",*\n * \"";FS="\" : \""}{if($1=="TRACKID"){print $2}}' "${GITDIR}/${IMAGEID}.tags")
|
local trackidList=$(awk -v field="\"TRACKID\"" 'BEGIN{RS="[,]?\n";FS=" : "}{if($1~field){print $2}}' "${GITDIR}/${IMAGEID}.tags" | tr -d '"')
|
||||||
|
|
||||||
# Then renames the ouput files to TRACKID
|
# Then renames the ouput files to TRACKID
|
||||||
local COUNT=1
|
local COUNT=1
|
||||||
|
|
|
@ -21,5 +21,5 @@ print_meta_field() {
|
||||||
# the last line (Thus the only relevant value). This permits us to use the MTAG's specs where tracks inherit
|
# the last line (Thus the only relevant value). This permits us to use the MTAG's specs where tracks inherit
|
||||||
# the values of its previous tracks when not set. Thus, one needs only to define the ALBUM once on the first
|
# the values of its previous tracks when not set. Thus, one needs only to define the ALBUM once on the first
|
||||||
# track for all other TRACKs to inherit it.
|
# track for all other TRACKs to inherit it.
|
||||||
awk -v track=${TRACK_NO} 'BEGIN {RS="\n * }"}{if(NR<=track){print $0}}' ${FILE} | awk -v field="\"${FIELD}\"" 'BEGIN{RS="[,]?\n";FS=" : "}{if($1~field){print $2}}' | tail -n 1 | sed -e 's/^"//' -e 's/"$//'
|
awk -v track=${TRACK_NO} 'BEGIN {RS="\n * }"}{if(NR<=track){print $0}}' ${FILE} | awk -v field="\"${FIELD}\"" 'BEGIN{RS="[,]?\n";FS=" : "}{if($1~field){print $2}}' | tail -n 1 | sed -e 's/^"//' -e 's/"$//' -e 's/\[//' -e 's/\]/ /'
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,8 +18,8 @@ print_meta_mtag() {
|
||||||
local TRACK_NO="${2}"; shift 2
|
local TRACK_NO="${2}"; shift 2
|
||||||
local tagList=(${@})
|
local tagList=(${@})
|
||||||
|
|
||||||
[[ -z "${tagList[@]}" ]] && local tagList=($(awk 'BEGIN{RS="\",*\n * \"";FS="\" : \""}{if($1!~"@"){print $1}}' ${FILE} | awk '!seen[$0]++') IMAGEID)
|
[[ -z "${tagList[@]}" ]] && local tagList=($(awk 'BEGIN{RS="[,]?\n";FS=" : "}{if($1!~"@"){print $1}}' ${FILE} | tr -d '[]{}" ' | awk '!seen[$0]++' | tail -n +3) IMAGEID)
|
||||||
|
|
||||||
for tag in ${tagList[@]}; do
|
for tag in ${tagList[@]}; do
|
||||||
# Finalizes output with IMAGEID
|
# Finalizes output with IMAGEID
|
||||||
[[ "${tag}" == "IMAGEID" ]] && { echo -n "IMAGEID=$(sed 's|.tags||g' <<< $(basename "${FILE}"))"; continue; }
|
[[ "${tag}" == "IMAGEID" ]] && { echo -n "IMAGEID=$(sed 's|.tags||g' <<< $(basename "${FILE}"))"; continue; }
|
||||||
|
|
Loading…
Reference in a new issue