Hello,
I'm trying to make a script that would add albumart into mp3 files I have that don't have one.
As I don't know python I'm doing it in bash.
pictures are in $HOME/.cache/vlc/art/artistalbum/<artist>/<album>/
songs are in $HOME/Hudba/no_art/
and the script is:
#!/bin/bash
#changes delimetres
SAVEIFS=$IFS
IFS=""
# process all mp3 files
ls $HOME/.cache/vlc/art/artistalbum/*/*/* | while read FILE ; do
ARTIST="${FILE%\/*\/*}"
ARTIST="${ARTIST##*/}"
ls $HOME/Hudba/no_art/* | while read SONGFILE; do
NAME="${SONGFILE##*/}"
NAME="${NAME% -*}" #name of artist (from songfile)
if [ "$NAME" = "$ARTIST" ]
then eyeD3 --add-image=$FILE:FRONT_COVER $SONGFILE
#echo "FILE $FILE"
#echo "SONGFILE $SONGFILE"
fi
done
done
#restores delimetres
IFS=$SAVEIFS
eyeD3 reports no errors and actually says that image was stored into file (+ eyeD3 <songfile> reports that image is stored there .. even with correct size), but when I look with some graphical id3 editor - there either isn't image , there is error , or some distorted image is displayed ...
When I go through script without the loops (i.e. manualy sets $FILE and $SONGFILE), then a picture is inserted without problems (i.e. I can see it in graphical id3 editor)
Thank you much for reading and if you could offer any help I would be grateful.
Bye,
Sip