-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathipodadd
executable file
·79 lines (67 loc) · 1.4 KB
/
ipodadd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
export IPOD_MOUNTPOINT=/media/ipod
mount $IPOD_MOUNTPOINT
if [ $? -ne 0 ]
then
echo Failed to mount iPod
exit 1
fi
ADDSONG="/usr/bin/gnupod_addsong"
WRITEDB="/usr/bin/mktunes"
IFS='
'
while :
do
echo hi
break
done
COVERART=`ls *.jpg *.JPG *.png *.PNG *.gif *.GIF 2>/dev/null | tail -n 1`
if [ ! -z $COVERART ]
then
echo Using "$COVERART" for album artwork.
else
echo "No cover art found in local directory, checking metadata"
for SONG in `ls *m4a`
do
echo checking $SONG
# Extract any artwork
AtomicParsley $SONG -E
COVERART=`ls *.jpg *.JPG *.png *.PNG *.gif *.GIF 2>/dev/null | tail -n 1`
if [ ! -z $COVERART ]
then
echo Using "$COVERART" for album artwork.
break
fi
done
fi
for SONG in `ls *m4a`
do
echo Adding \"$SONG\"
if [ -z $COVERART ]
then
$ADDSONG "$SONG"
fi
if [ ! -z $COVERART ]
then
$ADDSONG "$SONG" --artwork="$COVERART"
fi
done
for SONG in `ls *mp3`
do
if [ ! -z $COVERART ]
then
echo "Adding artwork \"$COVERART\" to mp3 file"
eyeD3 --add-image $COVERART:FRONT_COVER "$SONG"
fi
echo Adding \"$SONG\"
if [ -z $COVERART ]
then
$ADDSONG "$SONG"
fi
if [ ! -z $COVERART ]
then
$ADDSONG "$SONG" --artwork="$COVERART"
fi
done
$WRITEDB
umount $IPOD_MOUNTPOINT