File [scripts/check_music_covers.sh]
1 |
#!/bin/sh |
2 |
# |
3 |
# Check that there is an album cover in every album directory |
4 |
base_dir=$HOME/Music |
5 |
if [ $1 ]; then |
6 |
music_dir=$1 |
7 |
else |
8 |
echo "" |
9 |
echo "Please specify a music directory inside ${base_dir}" |
10 |
echo "" |
11 |
exit 1 |
12 |
fi |
13 |
tmpy=/tmp/check_music_covers |
14 |
# Create a tmp directory for dumps |
15 |
if [ ! -d "${tmpy}" ]; then |
16 |
mkdir ${tmpy} |
17 |
fi |
18 |
# Scan through all of the directories |
19 |
for this_music_dir in ${music_dir} |
20 |
do |
21 |
# Scan for artists |
22 |
echo "Scanning ${this_music_dir} directory ..." |
23 |
ls -1 "${base_dir}/${this_music_dir}" > ${tmpy}/${this_music_dir} |
24 |
# Scan for albums |
25 |
while read artist |
26 |
do |
27 |
ls -1 "${base_dir}/${this_music_dir}/${artist}" > ${tmpy}/${this_music_dir}-${artist} |
28 |
while read album |
29 |
do |
30 |
if [ -f "${base_dir}/${this_music_dir}/${artist}/${album}/folder.jpg" ]; then |
31 |
if [ "$2" = "-v" ]; then |
32 |
echo " ${artist} - ${album} - \"folder.jpg\" found" |
33 |
fi |
34 |
else |
35 |
echo " ${artist} - ${album} - \"folder.jpg\" NOT FOUND" |
36 |
fi |
37 |
done <${tmpy}/${this_music_dir}-${artist} |
38 |
done <${tmpy}/${this_music_dir} |
39 |
done |
40 |
# Now clean up the tmp area |
41 |
""rm -f -R ${tmpy} |
Computing Power
- Acer Aspire R3700
- Acknowledgements
- BOINC
- Desktop PC
- Eee PC 4G (701)
- Eee PC 901
- Gigabit Network
- Inspiron 14 5485 Laptop
- Kids PC 1
- Kids PC 2
- Media PC
- Mini-ITX PC
- My Useful Scripts
- Nano ITX PC
- Nook Simple Touch
- Processing Power
- Raspberry Pi
- Sharp Zaurus SL-C3200
- Storage Capacity
- The Server
- What Is Firmware
Galleries
(* updated in last 14 days)