dotfiles/dot_local/bin/executable_find-acoustid-dups

15 lines
434 B
Plaintext
Raw Normal View History

2023-09-15 15:46:04 -04:00
#!/bin/sh
for i in $(seq 1 60); do
if [ "$(find . -name "$i *" | wc -l)" = 2 ]; then
first_track="$(find . -name "$i *" | head -n1)"
last_track="$(find . -name "$i *" | tail -n1)"
first_acoustid="$(exiftool "$first_track" | rg Acoustid)"
last_acoustid="$(exiftool "$last_track" | rg Acoustid)"
if [ "$first_acoustid" = "$last_acoustid" ]; then
if [ "$first_track" != "$last_track" ]; then
rm "$first_track"
fi
fi
fi
done