rgammon51 has asked for the wisdom of the Perl Monks concerning the following question:

I want to read tags in MP3 files to reorganize my music files. The general order to do this is

If MP3Tag(album) is "Top 1000" and current directory is NOT /home/rgammon51/Temp/Music/Various THEN move file to /home/rgammon51/Temp/Music/Various/Top1000.

Its the MP3Tag thing that I search for. General web searches do not turn up anything useful.

I am fairly certain that I can do the rest of the file processing. I want to make this general so that "Top 1000" is passed as a parameter to the program.

The issue is that most music managers INSIST that a single artist appears on an Album. Movie Soundtracks are just one example of where that is simply NOT true.

Google Music ruined the organization that I want for my music files, on Google and on my computer due to this INSISTENCE on a single artist per album.

Replies are listed 'Best First'.
Re: Read MP3 tags
by kcott (Archbishop) on Apr 17, 2014 at 21:31 UTC
Re: Read MP3 tags
by hawtin (Prior) on Apr 18, 2014 at 18:19 UTC

    The issue you are up against is the difference between the track (i.e. file's) 'artist' attribute and the directory (i.e. album's) 'artist'. For me the only option that makes sense is to keep these distinct.

    You've obviously come across the case where the album should be assigned to 'Various Artists' (or your equivalent value) while each individual song is tagged with the appropriate artist. This is, however, just one example of the issue, look at Ellie Goulding's album "Halcyon", most of the songs (as you would expect) are by Ellie Goulding but one is by Calvin Harris & Ellie Goulding. What to do in this case? If this song is labeled as by Ellie Goulding then searching for material by Calvin Harris will fail, if it is properly labeled it gets shuffled off to a directory on its own? So yes this is exactly why you need to manage your own music files

    There are a number of ways to do this. The way I personally do it is to keep the tags completely separate from the files (in a single CSV file in my case). This lets me define any attributes I want, like a "album-artist" and "album-album" attributes in addition to the "song-artist" and "song-album" attributes. Then I can insert a subset of those tags into the audio files via the MP3::Tag and MP3::Info packages.

    I find that using a range of Perl scripts to coordinate audio files, directories, the CSV file and MP3 ID3v2 tags ensures my music is exactly where I want it.

      I, too, am using MP3::Tag to access already tagged mp3 music files. However, I'm challenged with special characters like the German umlaut. It doesn't appear that MP3::Tags translates the iTunes mp3 tag correctly. Any ideas?
        I'd try the usual stuff first: Encode.
        لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ