-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmp3-tagging.zsh
68 lines (59 loc) · 1.53 KB
/
mp3-tagging.zsh
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
# mp3 tagging
# set tags
alias idar="eyeD3 --artist" # -a
alias idal="eyeD3 --album" # -A
alias idarr="eyeD3 --album-artist" # -b
alias idt="eyeD3 --title" # -t
alias ids="idt"
alias idn="eyeD3 --track" # -n (-n 0 -N 0 to clear)
alias idy="eyeD3 --recording-date"
idco() {
local cover="$1:FRONT_COVER"
shift
eyeD3 --add-image "$cover" "$@"
}
alias getco="ffmpeg -y -i" # mp3 tmp/jpg
idcoa() {
local clip="$(get-clip)"
if echo $clip | grep -E '^https.+jpg$' >/dev/null; then
wget $clip -O cover.jpg
fi
if [ -e "cover.jpg" ]; then
echo "Tagging all mp3 files in this and all its subdirectories with cover.jpg"
printf "Ok? (Y/n): "
read ans
[ "$ans" != "n" ] && find . -name '*.mp3' -exec sh -c 'eyeD3 --add-image cover.jpg:FRONT_COVER "$1"' sh {} ';'
rm cover.jpg
else
echo "cover.jpg does not exist"
false
fi
}
# see ~/scripts/idmi
## get cover
function mpdcoloop() { # requires sxiv, fkill (npm: fkill-cli)
file="/home/jneidel/music/"$(mpc status -f "%file%" | grep mp3)
if [ $1 != "" ]; then
prev=$1
if [ $prev != $file ]; then
mdpco &
fi
fi
sleep 5
mpdcoloop $file &
}
function mpdcol() { # get cover & update cover once song changes
mpdco &
mpdcoloop N1 &
}
idgi() { # add intrumental as genre
genre="$(eyeD3 * | grep -Po "genre: \K.+(?= \()" | head -n1)"
printf "Current genre is: $genre\nContinue? (Y/n) "
read ans
[ "$ans" = "n" ] && exit 0
if [ -n "$genre" ]; then
eyeD3 --genre "${genre}Instrumental" *
else
eyeD3 --genre "Instrumental" *
fi
}