From eb9bd4ff6c93affdc613a25625156be67448cfdb Mon Sep 17 00:00:00 2001 From: Dmitry Smirnov Date: Fri, 5 Jul 2013 15:35:16 +1000 Subject: [PATCH] Use python-mutagen (`mid3v2`) or id3v2 instead of `mp3info` to tag (Debian: #676478) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This avoids truncating long titles/albums/etc. Author: Felipe Sateler Reviewed-By: Dmitry Smirnov Thanks-To: Rogério Brito. Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=676478 * Look for `mid3v2` first and fallback to `id3v2` according to their availability. * Added error message if neither of them found. --- src/tools/cuetag.sh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/tools/cuetag.sh b/src/tools/cuetag.sh index 2f26816..922ba69 100755 --- a/src/tools/cuetag.sh +++ b/src/tools/cuetag.sh @@ -93,7 +93,12 @@ vorbis() id3() { - MP3INFO=mp3info + MP3TAG=$(which mid3v2) \ + || MP3TAG=$(which id3v2) + if [ -z "${MP3TAG}" ]; then + echo "error: not found '(m)id3v2'." + exit 1 + fi # space seperated list of ID3 v1.1 tags # see http://id3lib.sourceforge.net/id3/idev1.html @@ -124,25 +129,25 @@ id3() if [ -n "$value" ]; then case $field in TITLE) - $MP3INFO -t "$value" "$2" + $MP3TAG -t "$value" "$2" ;; ALBUM) - $MP3INFO -l "$value" "$2" + $MP3TAG -A "$value" "$2" ;; ARTIST) - $MP3INFO -a "$value" "$2" + $MP3TAG -a "$value" "$2" ;; YEAR) - $MP3INFO -y "$value" "$2" + $MP3TAG -y "$value" "$2" ;; COMMENT) - $MP3INFO -c "$value" "$2" + $MP3TAG -c "$value" "$2" ;; GENRE) - $MP3INFO -g "$value" "$2" + $MP3TAG -g "$value" "$2" ;; TRACKNUMBER) - $MP3INFO -n "$value" "$2" + $MP3TAG -T "$value" "$2" ;; esac fi