# Smart playlists with backward slashes

**URL:** <https://discourse.beets.io/t/smart-playlists-with-backward-slashes/2250>\
**Category:** Help\
**Created:** [February 1, 2023, 2:48pm UTC](https://discourse.beets.io/t/smart-playlists-with-backward-slashes/2250 "2023-02-01T14:48:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sindreruud](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/sindreruud/32/582_2.png) [@sindreruud](https://discourse.beets.io/u/sindreruud)\
**Post date:** [February 1, 2023, 2:48pm UTC](https://discourse.beets.io/t/smart-playlists-with-backward-slashes/2250/1 "2023-02-01T14:48:38Z")

</div>

Hi!

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

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  
Z:\media\music

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?

---

<div class="post-metadata">

**Author:** ![adrian](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/adrian/32/4_2.png) [@adrian](https://discourse.beets.io/u/adrian)\
**Post date:** [February 3, 2023, 7:37pm UTC](https://discourse.beets.io/t/smart-playlists-with-backward-slashes/2250/2 "2023-02-03T19:37:11Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![sindreruud](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/sindreruud/32/582_2.png) [@sindreruud](https://discourse.beets.io/u/sindreruud)\
**Post date:** [February 4, 2023, 4:20pm UTC](https://discourse.beets.io/t/smart-playlists-with-backward-slashes/2250/3 "2023-02-04T16:20:53Z")

</div>

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](https://github.com/regorxxx/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:

> playlist:  
> auto: no  
> playlist\_dir: /mnt/music-playlists  
> relative\_to: /mnt/music
> 
> smartplaylist:  
> auto: yes  
> playlist\_dir: /mnt/music-playlists/foobar2000  
> relative\_to: /mnt/music  
> prefix: Z:/media/music/  
> playlists:  
> - name: ‘imports\_%time{$added,%Y\_%m\_%d}.m3u8’  
> query: ‘’
> 
> smartplaylist:  
> auto: yes  
> playlist\_dir: /mnt/music-playlists/management/master-imports  
> relative\_to: /mnt/music  
> playlists:  
> - 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 🙂

---

<div class="post-metadata">

**Author:** ![adrian](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/adrian/32/4_2.png) [@adrian](https://discourse.beets.io/u/adrian)\
**Post date:** [February 11, 2023, 12:53am UTC](https://discourse.beets.io/t/smart-playlists-with-backward-slashes/2250/4 "2023-02-11T00:53:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![simistef](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/simistef/32/699_2.png) [@simistef](https://discourse.beets.io/u/simistef)\
**Post date:** [March 4, 2023, 5:47am UTC](https://discourse.beets.io/t/smart-playlists-with-backward-slashes/2250/5 "2023-03-04T05:47:39Z")

</div>

+1 on this feature
