-
Notifications
You must be signed in to change notification settings - Fork 0
/
fixalltag2
65 lines (51 loc) · 1.1 KB
/
fixalltag2
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
#!/bin/zsh
for i in *.sfv(N); do
if ! sfv-hash -c $i; then
echo "Broken files detected!"
exit 1
fi
done
for i in log cue m3u nfo sfv m3u ffp accurip rtf; do
find . -maxdepth 1 -type f -iname "*.$i" -delete
done
mid3v2 -D *.flac
echo "Checking for broken flac files, just a moment."
find . -type f -iname '*.flac' -print0 | xargs -0 flac -wst > broken_flac.log 2>&1
if [[ -s broken_flac.log ]]; then
echo "Broken flacs detected." >&2
cat broken_flac.log
exit 1
else
rm broken_flac.log
fi
while :; do
if ! pgrep -f 'picard ' -u $USER >& /dev/null; then
break
fi
echo -n '.'
sleep 5
done
cd .
picard .
if [[ $1 == -l ]]; then
lyrics
fi
if [[ $1 == -L ]]; then
lyrics -L
fi
if [[ ! -e dr14-DR*.txt ]]; then
dr14_tmeter
fi
spectrogram
rsgain easy -S -m4 .
set -x
album=$(metaflac --show-tag=ALBUM "$(ls -1 *.flac|head -n1)")
album="${album#album=}"
album="${album#ALBUM=}"
# Don't move it if it's already in /music
if ! pwd | grep -q /music; then
cwd=${PWD##*/}
cd ../
mv "$cwd" ~/done/"$album"
chmod -R g+w ~/done/
fi