Active Topics

 


Reply
Thread Tools
qwazix's Avatar
Moderator | Posts: 2,622 | Thanked: 5,447 times | Joined on Jan 2010
#1
Disclaimer: I am not sure that all albums retain their art. Most of mine didn't have anyway, but those that I remeber having album art still have after applying the script and rebuilding tracker db. (rebuilding the db is NOT required I just did it for testing purposes)

Code:
#!/bin/sh
flag=0
#Recursively rename AlbumArt Files 
find MyDocs/.sounds/ -name AlbumArt* | while read FILE 
do 
flag=1
NEW=`echo $FILE | sed -e 's/AlbumArt/.AlbumArt/'`
echo "renaming $FILE to $NEW"
mv "$FILE" "$NEW"
done

find MyDocs/.sounds/ -name folder.jpg | while read FILE 
do 
flag=1
NEW=`echo $FILE | sed -e 's/folder/.folder/'`
echo "renaming $FILE to $NEW"
mv "$FILE" "$NEW"
done

if [ $flag -eq 0 ]
then 
echo "no files found" 
fi
Maybe you need another block for Folder.jpg, maybe it's better to hide all jpg's in .sounds. This did most of the trick for me, I'll do the rest by hand, if you make any changes post back.

edit: the script doesn't delete anything, it just recursively makes AlbumArtblahblah and folder.jpg's hidden
 

The Following 2 Users Say Thank You to qwazix For This Useful Post:
5spdvl's Avatar
Posts: 220 | Thanked: 66 times | Joined on Aug 2010 @ Melbourne, Australia
#2
Geez, this is good. I need one to hide all the Starcraft and Warcraft II tilesets! But good work.
 
jedi's Avatar
Posts: 1,411 | Thanked: 1,330 times | Joined on Jan 2010 @ Tatooine
#3
This was my version:
Code:
#!/bin/sh
MUSICDIR="/home/user/MyDocs/Music"
find "${MUSICDIR}" -iname *.jpg -o -iname *.jpeg | while IFS="" read FILE; do 
   DIRNAME=`dirname "${FILE}"`
   LASTPART=`echo "${DIRNAME}" | awk -F '/' '{print $NF}'`
   if [ "${LASTPART}" != ".mediaartlocal" ]; then
      if [ "$1" = "-d" ]; then  
         echo "${FILE} will be moved to ./mediaartlocal/"
      else
         echo "Moving ${FILE} -> ./mediaartlocal/"
         if [ ! -d "${DIRNAME}/.mediaartlocal/" ]; then
            mkdir "${DIRNAME}/.mediaartlocal/" 
         fi 
         mv "${FILE}" "${DIRNAME}/.mediaartlocal/"
      fi
   fi
done
Which does pretty much the same. You can run it with a '-d' option to simulate a dry-run (ie it won't change/move anything)
__________________
May the source be with you.
 

The Following 3 Users Say Thank You to jedi For This Useful Post:
5spdvl's Avatar
Posts: 220 | Thanked: 66 times | Joined on Aug 2010 @ Melbourne, Australia
#4
Re: the above, some of my album art files are in .png format.

Can you change

Code:
find "${MUSICDIR}" -iname *.jpg -o -iname *.jpeg etc
to include

Code:
-iname *.png
? And any other file types?
 
jedi's Avatar
Posts: 1,411 | Thanked: 1,330 times | Joined on Jan 2010 @ Tatooine
#5
Originally Posted by 5spdvl View Post
Re: the above, some of my album art files are in .png format.

Can you change

Code:
find "${MUSICDIR}" -iname *.jpg -o -iname *.jpeg etc
to include

Code:
-iname *.png
? And any other file types?
You can do whatever you like with the script!

You can have as many "-name *.xxx" parameters as you need with the find command...
__________________
May the source be with you.
 

The Following User Says Thank You to jedi For This Useful Post:
Reply

Tags
album art, music player, tracker


 
Forum Jump


All times are GMT. The time now is 19:52.