Just a little backgroud, I have a library of mp3 files in the following structure: /mp3/artist/album/track.mp3
Also contained in each album directory is a cover.jpg which contains the cover art file for that particular album.
I want to add the cover.jpg to the mp3 tag and have been using eyed3 to do this, but would now like to batch process the entire library. Here is the command syntax I have been using:
find -type f -name "*.mp3" -exec eyeD3 --add-image=cover.jpg:FRONT_COVER {} \;
The problem is that the find command only passes the mp3 file name to the eyed3 command and without the directory path the cover.jpg is not found.
either there is something simple I need to add to the line or create a bash script with variables (this is beyond my abilities )
Thanks for your replies. I am running this command from the ~/mp3 directory
ludwig: I thought your second suggestion might solve the problem but instead of not finding the cover.jpg file I am now getting the track.mp3 file not found:
/media/ExtHDD/mp3 $ find -type f -name "*.mp3" -exec eyeD3 --add-image=cover.jpg:FRONT_COVER \'{}\' \;
File Not Found: './a-ha/Headline and Deadlines - The Hits of a-ha/Cry Wolf.mp3'
File Not Found: './a-ha/Headline and Deadlines - The Hits of a-ha/Crying in the Rain.mp3'
File Not Found: './a-ha/Headline and Deadlines - The Hits of a-ha/Early Morning.mp3'
blah, blah ......
I think the problem is the leading ./ How do I get rid of that?
Right, suddenly twigged what's going on, the command works if the path for the cover.jpg is included but this will obviously vary according to album. So basically what I need is to create a variable for the album path and pass it to the eyeD3 command so that it looks like:
I also tried -execdir as this is supposed to execute the command from the directory where the file is, but still no luck?
~ $ find /media/ExtHDD/mp3 -type f -name "*.mp3" -execdir eyeD3 --add-image=cover.jpg:FRONT_COVER \'{}\' \;
File Not Found: './Cry Wolf.mp3'
File Not Found: './Crying in the Rain.mp3'
File Not Found: './Early Morning.mp3'
:wall:
Would it be possible to use the printf %h to specify the path?
Thanks