Created
November 3, 2019 19:30
-
-
Save oliver-la/4611950a1bbe382fa085b12ea43d1ed5 to your computer and use it in GitHub Desktop.
Creates m3u for soundiiz import for a given directory. The directory must recursively contain .flac files with the filename format: TRACKNUM - ARTISTNAME - TRACKNAME.flac
This file contains 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/bash | |
PLAYLIST=$1 | |
if ! [ -d "$PLAYLIST" ]; then | |
echo "Please enter a valid path" | |
exit | |
fi | |
echo "#EXTM3U" > "$PLAYLIST.m3u" | |
find "$PLAYLIST" -type f -iname "*.flac" -printf "%f\n" | sed -n "s/^.* \- \(.* \- .*\)\.flac$/\1/p" | sed -e 's/^/#EXTINF:0,/' >> "$PLAYLIST.m3u" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment