I like to change my tags by manipulating my local cddb cache (~/.cddb/*, in my case). I hand edit the files in there, and then run my retag script on the appropriate files. This pulls in the data from the CDDB files, and sets the tags appropriately. Frequently, changing the tags will change the way I want to store the files. For this purpose, I have the reorg script below, which will rename and move files to the appropriate place in my music tree.
To facilitate this, I make sure to tag all files with track and CDDB ID number. In MP3 files, the CDDB ID goes into a TXXX tag, with a CDDB description. With FLAC, the tag is just CDDB. abcde needs to be changed slightly to handle this. First, change the tagging command for mp3's to include the TXXX line shown below:
run_command tagtrack-$1 $TAGGER $TAGGEROPTS -c "$COMMENTOUTPUT" \
-A "$DALBUM" -a "$TRACKARTIST" -t "$TRACKNAME" -y "$CDYEAR" \
-g "$GENREID" -T "${TRACKNUM:-$1/$TRACKS}" \
--TXXX "CDDB:$DISCID" \
"$ABCDETEMPDIR/track$1.$OUTPUT"
and change the script for the FLAC to have the line
ECHO CDDB=$DISCIDThis second line is broken in the current version (2.3.3) of abcde. The former needs to be hardcoded, as apparently it can't be set in the ID3V2OPTS option, presumably because it contains a variable.
Also, I only tag with ID3v2 tags, not ID3v1. All the devices I use, SlimServer/SqueezeBox, Phatnoise Phatbox, and iPod/iPod nano understand ID3v2, so why bother with ID3v1? Let me know if you've got a good reason why I'd want to.
% perl -MCPAN -e shelland then execute the following commands at the shell:
install MP3::Tag install Audio::FLAC::Header install CDDB::File
Unfortunately, there's no great way to tell what FreeDB has given you. I try to make sure I convert files to Latin1, and store them consistently that way. Also, be sure to convert all CDDB files to Unix format, as they seem to be coming through in DOS format (ie, carriage return/newline pairs, rather than Unix style single newlines).
When using abcde as your encoder, if your artists, albums, or track titles contain non-ASCII/non-English characters, you're likely to get your filenames all mangled. For instance, the group Värttinä gives abcde fits. The file names will be created in Latin1 characters, and the FLAC files will not get tagged at all. After correcting any data in my CDDB database, I use the following command:
retag -t tracknumber -i CDDBID track.mp3 reorg track.mp3to get the files in the right place.
Usage: autoencode [options] --dir directory where to look for ABCDE directories to encode. Default: /tmp/music --sleep minutes How long to sleep between attempts to find work. Default: 30 minutes. --[no]verbose Talk a lot. Default: be quiet. --loops numLoops Number of loops at files to handle. Default: Unlimited. --[no]notify Send mail when abced jobs fail. Default: no. --address address Address where to send the mail to. Default: The logged in user at the current domain. --nice nicelevel Nice level to run at. Default: 10 --[no]quietabcde Send abcde output to /dev/null. Default: shut it up. --[no]daemon Log each job completing to the syslog. Default: no. --script ABCDE script to run. Default: /usr/local/bin/abcde --help This stuff.
Usage: retag [options] files --db directory Where to search for CDDB files. Default: $HOME/.cddb --cddb file File to load CDDB data from. Prevents lookup in DB. Default: None. --id CDDB_ID ID to use to tag these files. Overrides any CDDB tags in the file. Default: use the file. --track track Track number to lookup based on. Overrides any track tags in the file. Default:use the file. --[no]utf8 CDDB files are in UTF-8. Default: No (Latin1). --help This stuff.
Usage: reorg [options] files directories --base directory Base directory for your collection. Default: Yes. --various string Directory to put compilation albums in. Defaut: VariousArtists --drag file Filename to "drag" along with moved files. Can be used multiple times. Default: cover.jpg --[no]compilation Force these files to be in a compilation. Default: No. --[no]utf8 Create filenames in UTF-8. Default: Yes. --[no]rename Actually do the renaming. Useful for testing. Default: yes. --[no]clean Clean up empty directories. Default: no. --help This stuff.