add albumart from vlc downloaded art folder (or any similar folder structure)

34 views
Skip to first unread message

ba...@seznam.cz

unread,
May 25, 2015, 1:58:22 PM5/25/15
to eyed3...@googlegroups.com
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


Travis Shirk

unread,
Jun 3, 2015, 4:21:23 PM6/3/15
to eyed3...@googlegroups.com
Hi, Sip.

Not sure about the entire script, but 'eyeD3
--add-image=$FILE:FRONT_COVER $SONGFILE' seems to work when passed
the
right values. I might suggest it may be a shell quoting problem, but
I've experimented. Good luck.

-travis
> --
> You received this message because you are subscribed to the Google Groups
> "eyeD3-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to eyed3-users...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages