aboutsummaryrefslogtreecommitdiff
path: root/bin/beet-rmdupes
blob: c39ad036c79584a6c28572539b96df90b6d13708 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

n=
while getopts :n arg >/dev/null 2>&1; do
    case "${arg}" in
        n)
            n=n
            ;;
        ?)
            :
            ;;
    esac
done
shift $(( OPTIND - 1 ))

find ~/audio/library// -type f -exec mimefilter -0 'audio/*' {} + \
    | xe -j0 -0s ' \
        f="${1}"; \
        s="${f#*//}"; s="${s%.*}"; \
        set -- ~/audio/lossless/"${s}".*; \
        [ -e "$1" ] || printf "%s\0" "${f}" \
    ' \
    | xe -0 -N0 -v${n} rm