Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Recursive creation of M3U files (Read 2716 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Recursive creation of M3U files

I'm new to foobar2000 (but not new to audio conversion software). I've been living in the Linux world for a couple of years, but have set up a Windows 7 machine for Windows Media Center (and the integrated Netflix streaming).

I'm also in the process of converting all my CDs (1600 of them) to FLAC.

I'm storing my FLACs in an "Artist\Year - Album\Track# Title" hierarchy, and I'm looking for a way to create an M3U playlist file in each album subfolder (in a recursive batch manner), with a filename of "Artist - Album.m3u". Can foobar2000 be leveraged to do this? Or does anyone know of some other utility that works in Windows 7?

Thanks for any info.

Recursive creation of M3U files

Reply #1
I think there are scripts for that on net, although it can be done with foobar also, i.e. with "text tools > advanced" enter:

Code: [Select]
echo %filename_ext% >> "$ansi($directory_path(%path%)\%album artist% - %album%.m3u)"

as track pattern, then copy result in batch file and run it.

Just be careful about 255 character limitation for path

[edit] I'm not sure if limitation is for filename, or path, but this is safe:

Code: [Select]
$ifgreater($len($directory_path(%path%)\%album artist% - %album%.m3u),255,,
echo %filename_ext% >> "$ansi($directory_path(%path%)\%album artist% - %album%.m3u)"
)

Recursive creation of M3U files

Reply #2
I think there are scripts for that on net, although it can be done with foobar also, i.e. with "text tools > advanced" enter:

Code: [Select]
echo %filename_ext% >> "$ansi($directory_path(%path%)\%album artist% - %album%.m3u)"

as track pattern, then copy result in batch file and run it.

Just be careful about 255 character limitation for path

[edit] I'm not sure if limitation is for filename, or path, but this is safe:

Code: [Select]
$ifgreater($len($directory_path(%path%)\%album artist% - %album%.m3u),255,,
echo %filename_ext% >> "$ansi($directory_path(%path%)\%album artist% - %album%.m3u)"
)


Thanks, this works great
<3 f00


Recursive creation of M3U files

Reply #4
It is if you don't explicitly use the \\.\ path prefix. foobar2000 uses this prefix when addressing local files, and thus bypasses the limitation.