# Importing Singles as a Playlist

**URL:** <https://discourse.beets.io/t/importing-singles-as-a-playlist/989>\
**Category:** Help\
**Created:** [October 29, 2019, 10:36am UTC](https://discourse.beets.io/t/importing-singles-as-a-playlist/989 "2019-10-29T10:36:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![barbz127](https://avatars.discourse-cdn.com/v4/letter/b/51bf81/32.png) [@barbz127](https://discourse.beets.io/u/barbz127)\
**Post date:** [October 29, 2019, 10:36am UTC](https://discourse.beets.io/t/importing-singles-as-a-playlist/989/1 "2019-10-29T10:36:17Z")

</div>

Hi,

I have a couple of dozen folders which contain songs that I like to play regularly or the kids etc - the songs dont relate but I do have a playlist file setup for these at the moment.

The files are currently saved outside of the beets music directory.

Can I import these as singles and have beets create a playlist on the fly so I can still play these songs as I do now but include them in the library?

Or is there better way to handle playlists that doesnt involve getting rid of them?

Thankyou

---

<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:** [October 29, 2019, 12:04pm UTC](https://discourse.beets.io/t/importing-singles-as-a-playlist/989/2 "2019-10-29T12:04:47Z")

</div>

Hi! I think an easy way to do this would be to set a special field on some singletons you import. For example, you could use `beet import -s --set playlist=my_playlist`. Then, to get a list of all the songs with that tag, use `beet ls playlist:my_playlist`.

You can even set up a `paths:` rule in your config that will group all these files together in a single directory. Maybe something like this:

```auto
paths:
    'playlist:my_playlist': Playlists/My Playlist/$artist - $title

```

---

<div class="post-metadata">

**Author:** ![barbz127](https://avatars.discourse-cdn.com/v4/letter/b/51bf81/32.png) [@barbz127](https://discourse.beets.io/u/barbz127)\
**Post date:** [October 30, 2019, 3:56am UTC](https://discourse.beets.io/t/importing-singles-as-a-playlist/989/3 "2019-10-30T03:56:26Z")

</div>

Thankyou,

With the second option this would import all playlists into one folder or would I need to have a path option for each playlist to ensure they ended up in their own named folder?

---

<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:** [October 30, 2019, 4:07pm UTC](https://discourse.beets.io/t/importing-singles-as-a-playlist/989/4 "2019-10-30T16:07:56Z")

</div>

Well, you could put `$playlist` into your path format to get differently-labeled music to go into different directories! Then use `--set playlist=foo` and `--set playlist=bar` to choose different names. You’ll want to change the query predicate in the `paths:` section to something like `playlist::.` to match all tracks with a non-empty `$playlist` field.

---

<div class="post-metadata">

**Author:** ![barbz127](https://avatars.discourse-cdn.com/v4/letter/b/51bf81/32.png) [@barbz127](https://discourse.beets.io/u/barbz127)\
**Post date:** [November 3, 2019, 10:19am UTC](https://discourse.beets.io/t/importing-singles-as-a-playlist/989/5 "2019-11-03T10:19:45Z")

</div>

Sorry - can I please grab some more assistance with this?

With

`playlist::. Playlists/$playlist/$artist - $title` in my config I get the following errors

```
    beets\config.yaml could not be read: while scanning a simple key
      in "C:\Users\user\AppData\Roaming\beets\config.yaml", line 13, column 5
    could not find expected ':'
      in "C:\Users\user\AppData\Roaming\beets\config.yaml", line 13, column 53

```

If I change that just to `playlist: Playlists/$playlist/$artist - $title` files import as if they were albums and I dont get an option to import as tracks (well it doesnt prompt).

code used for the import is  
` beet import -s --set playlist="soundscape" Soundscape`

thankyou

---

<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:** [November 3, 2019, 2:26pm UTC](https://discourse.beets.io/t/importing-singles-as-a-playlist/989/6 "2019-11-03T14:26:16Z")

</div>

Hi! Take a look again at the YAML syntax I suggested above:

```auto
paths:
    'playlist::.': Playlists/$playlist/$artist - $title

```

You may also want to read the YAML documentation to understand exactly what’s going on here. But the thing is that you need to put the left-hand of the `key: value` pair in quotes if it contains a colon.
