Skip to content

Instantly share code, notes, and snippets.

@oliver-la
Created November 3, 2019 19:30
Show Gist options
  • Save oliver-la/4611950a1bbe382fa085b12ea43d1ed5 to your computer and use it in GitHub Desktop.
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
#!/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