Ubuntu – How to make the folder name as Album tag for mp3

bansheemp3Ubuntu

I have a bunch of mp3 and when I import them in Banshee, it's all messed up. The mp3 files I have are organized by folder and I would like to make the folder name as the album tag for the mp3, so that I can sort them easily in Banshee.

I tried easytag and audio tag tool, but was not able to figure it out. Could anyone provide me with instructions for making the folder name as album tag for mp3 in batch?

BTW, I am using Ubuntu 11.10.

Edit: For some reason which I am not aware of, the below solution of using tagmp3 doesn't work for me neither using the script or the tagmp3 directly from the terminal.

Best Answer

You can use id3v2.

If it is not there install it..

apt-get install id3v2

Try this

find . | grep .mp3$ > /tmp/flist

while read line    
do    
  dir=${line%/*}
  file=${line##*/}
  folder=${dir##*/}
  id3v2 --album "$folder" "$file"

done < /tmp/flist
Related Question