[gen_tracks] Now supplies shntool with adequate file name

This commit is contained in:
ayakael 2018-07-19 06:35:51 -08:00
parent 341289bc68
commit c8faabe714
No known key found for this signature in database
GPG key ID: 575626A4AE5F4026

View file

@ -25,8 +25,8 @@ gen_tracks() {
[[ -z "${breakpointList[@]}" ]] && { cat "${IMAGE}" > ${GITDIR}/split-track01.flac; return 0; }
# Attempts first split. If fails because of lack of CD quality file, retries with modified breakpointList
if ! printf '%s\n' ${breakpointList[@]} | shntool split -o flac -O always -d "${GITDIR}" "${IMAGE}.flac" ; then
printf '%s\n' ${breakpointList[@]} | sed s/$/0/ | shntool split -o flac -O always -d "${GITDIR}" "${IMAGE}.flac"
if ! printf '%s\n' ${breakpointList[@]} | shntool split -o flac -O always -d "${GITDIR}" "${IMAGE}" ; then
printf '%s\n' ${breakpointList[@]} | sed s/$/0/ | shntool split -o flac -O always -d "${GITDIR}" "${IMAGE}"
[[ $? -ne 0 ]] && return 1 || return 0
fi