Created
December 19, 2017 20:06
-
-
Save hfs/1b7c120c07ce63cd9105ed59788a6915 to your computer and use it in GitHub Desktop.
Remove duplicates (by file path) from the MPD playlist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Remove duplicates from MPD playlist. | |
# Export MPD_HOST and MPD_PORT if you want to connect to a different host. | |
mpc playlist -f '%position%\t%file%' | sort -k 2 | perl -ne 'm/(.*)\t(.*)/; print "$1\n" if $2 eq $prev; $prev=$2' | mpc del |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
an alternative: