/
no-music
executable file
·47 lines (44 loc) · 1.07 KB
/
no-music
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
#!/bin/sh
isassetdir() {
d=$1
name=$(echo "${d##*/}" | tr '[:upper:]' '[:lower:]')
test "$name" = '@eadir' \
-o "$name" = '300-dpi scans' \
-o "$name" = 'album art' \
-o "$name" = 'art' \
-o "$name" = 'artwork' \
-o "$name" = 'bonus' \
-o "$name" = 'booklet' \
-o "$name" = 'c_scan-dg-ilbon2000' \
-o "$name" = 'covers' \
-o "$name" = 'hq covers' \
-o "$name" = 'immagini' \
-o "$name" = 'jacket and disc' \
-o "$name" = 'playlists' \
-o "$name" = 'scans' \
-o "$name" = 'sequencer' \
-o "$name" = 'technical spec' \
-o "$name" = 'video links'
}
test $# -gt 0 || {
echo "Usage: no-music <directory-tree-to-check> ..."
exit 1
}
find $@ -maxdepth 1 -type d | while read dir
do
isassetdir "$dir" && continue
ok=
for f in "$dir"/*
do
test -d "$f" && ! isassetdir "$f" && ok=1 && break # not a leaf
f=$(echo "$f" | tr '[:upper:]' '[:lower:]')
ext=${f##*.}
case "$ext" in
ape|flac|m4a|mp3|ogg|opus|wma)
ok=1
break
;;
esac
done
test "$ok" || echo "$dir"
done