Smart playlists with backward slashes


My music resides on a TrueNAS / FreeBSD system, so the paths for my music is

I use smart playlist to create playlist for each import-session I have, so I can easily listen to my newly imported music in a convenient playlist.

However, my music player of choice is Foobar on a Windows machine, where the music is mounted as a network drive. The path that Foobar sees is therefore

I can configure Smart Playlist to use relative paths as so
Artist/Album/1. track.flac

And I can even use the prefix to have it be
Z:\media\music/Artist/Album/. track.flac

But is there any way to have it use backward slashes (backslash ) for the path? I can only see the option to force forward slash with forward_slash, but setting this to no doesn’t work.

Any suggestions? Or would I have to change the code?

Interesting! Just to confirm, the situation is that you want to create these playlists on a Unix system but use them on a Windows system—is that right? (I would guess that the playlist would already use Windows-style backslash-delimited paths if beets were running on Windows itself.)

We don’t have a great way to do that… but it might not be too difficult to accomplish, if you want to try opening an issue?

1 Like

The playlists will be created on a unix system but used on a windows system - so yes, correct!

I just realized a different problem though. I made a simple python script to flip the slashes and prefix it with my drive letter, and it’s working on windows as I want it.
However beets is then no longer able to query the library with the playlists, obviously. And that’s part of my workflow.
beet ls playlist:/path/to/playlist.m3u

So I will not open an issue for this, I think it’s outside the scope of this plugin anyway.

However, to anyone else stumbling across this post in the future. There is a plugin for Foobar2000 called Playlist-Manager-SMP, and that plugin actually don’t care if the path has forward or backslashes.

However, what would be nice is to have two seperate smart playlist configs in the same beet config. To track two different playlist-folders. Then you could have one folder for playlists with relative or absolute paths that you can use on unix system, and you could use it to query the beets library with beet ls. And then you could have a second playlist folder with relative paths and a prefix for a network location or a drive letter or whatever you want. Something like this:

auto: no
playlist_dir: /mnt/music-playlists
relative_to: /mnt/music

auto: yes
playlist_dir: /mnt/music-playlists/foobar2000
relative_to: /mnt/music
prefix: Z:/media/music/
- name: ‘imports_%time{$added,%Y_%m_%d}.m3u8’
query: ‘’

auto: yes
playlist_dir: /mnt/music-playlists/management/master-imports
relative_to: /mnt/music
- name: ‘imports_%time{$added,%Y_%m_%d}.m3u8’
query: ‘’

Is this at all possible to achieve? I think it would also be more in scope with the plugin. I tried the above config but it only uses the first smartplaylist block of the config, not the second.

Thank you for the reply :slight_smile:

One thing you could try is the -c flag. Doing beet -c otherconfig.yaml … lets you “overlay” a second set of config options, which might work to replace your smartplaylist config with a new one.

+1 on this feature