Reply To: Script for creating my playlist?

#8033
rpedde
Participant

@krolben wrote:

The structure of my music folders is:
/home/music/band name/album name/music file

The naming convention I’d like to have in the playlist is:
“band name – album title” {
paths to songs
}

Not much of a shell scripter myself, but something like this ought to work:


#!/bin/sh

for artist in *; do
if [ -d "$artist" ]; then
pushd "$artist"
for album in *; do
find "$album" -name '*.mp3' -o -name '*.m4a' > "$artist - $album.m3u"
done;
popd
fi;
done;

That should make .m3u files for each album, or so I reckon.