# Copyright (c) 1998-2001 Robert Woodcock <rcw@debian.org>
# Copyright (c) 2003-2006 Jesus Climent <jesus.climent@hispalinux.es>
# Copyright (c) 2009-2012 Colin Tuckley <colint@debian.org>
-# Copyright (c) 2012-2018 Steve McIntyre <93sam@@debian.org>
+# Copyright (c) 2012-2019 Steve McIntyre <93sam@@debian.org>
# Copyright (c) 2015-2017 Andrew Strong <andrew.david.strong@gmail.com>
# This code is hereby licensed for public consumption under either the
# GNU GPL v2 or greater, or Larry Wall's Artistic license - your choice.
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-VERSION='2.9.2-DEV'
+VERSION='2.9.4-DEV'
usage ()
{
if [ -n "$STARTTRACKNUMBER" ] ; then
# Get the trackpadding from the current track, also trim whitespace for MacOSX
CURRENTTRACKPADDING=$(echo -n "$UTRACKNUM" | wc -c | tr -d ' ')
- TRACKNUM=$( printf %0.${CURRENTTRACKPADDING}d $((${UTRACKNUM} + ${STARTTRACKNUMBER} - ${FIRSTTRACK})))
+ REALTRACKNUM=$(expr $UTRACKNUM + 0) # Unpad
+ TRACKNUM=$( printf %0.${CURRENTTRACKPADDING}d $((${REALTRACKNUM} + ${STARTTRACKNUMBER} - ${FIRSTTRACK})))
else
TRACKNUM=${UTRACKNUM}
fi
CDPARANOIAAUDIOTRACKS="$TRACKS"
LEADOUT="$(echo "$CDPARANOIAOUTPUT" | grep -Eo '^TOTAL[[:space:]]+([[:digit:]]+)' | get_last)"
- OFFSETS="$(echo "$CDPARANOIAOUTPUT" | sed -n -e's/^ .* \([0-9]\+\) \[.*/\1/p')"
+ OFFSETS="$(echo "$CDPARANOIAOUTPUT" | awk '/^ +.*\[/ {print $4}')"
makeids
;;
*)
# Do we have CD-Text on the disc (and can the drive read it?)
(
cd "${SOURCE_WORKDIR}" && rm -f audio.* audio_*
- ${CDTEXT_READER} -J -v titles -D "${CDDA2WAVCDROM}" > "${SOURCE_WORKDIR}/cd-text" 2>&1
+ # Even redirect fd 0 to our output file. It seems cdda2wav
+ # writes to stdin too these days. Bizarre, buggy
+ # behaviour! Should be harmless for icedax.
+ ${CDTEXT_READER} -J -v titles -D "${CDDA2WAVCDROM}" > "${SOURCE_WORKDIR}/cd-text" 2>&1 0>&1
)
grep -a -q '^CD-Text: detected' "${SOURCE_WORKDIR}/cd-text"
ERRORCODE=$?
# use glyrc
if [ ! -s "${ABCDETEMPDIR}/$ALBUMARTFILE" ]; then
vecho "trying to get cover with glyrc for $ARTISTFILE / $ALBUMFILE" >&2
- $GLYRC cover --artist "$ARTISTFILE" --album "$ALBUMFILE" --write "${ABCDETEMPDIR}/$ALBUMARTFILE" $GLYRCOPTS
+ env LC_ALL=C $GLYRC cover --artist "$ARTISTFILE" --album "$ALBUMFILE" --write "${ABCDETEMPDIR}/$ALBUMARTFILE" $GLYRCOPTS
if [ $? -ne 0 ]; then
vecho "could not download cover with glyrc" >&2
else