# Paths for files with a custom field present

**URL:** https://discourse.beets.io/t/paths-for-files-with-a-custom-field-present/683
**Category:** Help
**Created:** [March 30, 2019, 12:58pm UTC](https://discourse.beets.io/t/paths-for-files-with-a-custom-field-present/683 "2019-03-30T12:58:49Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![anotherhowie](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/anotherhowie/32/215_2.png) [@anotherhowie](https://discourse.beets.io/u/anotherhowie)
#### Post date: [March 30, 2019, 12:58pm UTC](https://discourse.beets.io/t/paths-for-files-with-a-custom-field-present/683/1 "2019-03-30T12:58:49Z")

</div>

I have most of my collection under control with Beets now, but one thing I previously have had that I’d like to retain is a “Collections” folder, separate from Compilations, for large series of Compilations (I collected Mastercuts and Streetsounds compilations in the 90s, for example). So I’ve figured out I can add a new field for those like this:

```
beet modify collection="Now That’s What I Call Music!" album:"Now That’s What I Call Music"

```

with the intention that I can do something like:

```
collection::^.+: Collections/$collection/$album%aunique{} [$year]/$track $title - $artist

```

to file them for me.

Except it doesn’t work. Is there a less tricky way to match on “exists and has a value” in the path specification?

Slightly related: Is there a way to exactly match an album title? For the “Now That’s What I Call Music!” series, all but the first two releases have a number after (the second had II). The very first one has an incorrect release date in MusicBrainz. How can I select that album to use “beet modify” and correct it?

---

<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: [March 30, 2019, 4:14pm UTC](https://discourse.beets.io/t/paths-for-files-with-a-custom-field-present/683/2 "2019-03-30T16:14:08Z")

</div>

Cool idea! I think this should work—in fact, `collection::.` should work as the query. To figure out what’s going wrong, l recommend debugging using `beet list` first:

```
$ beet list collection::.

```

to make sure this matches what you want. Then, if it does, focus on the ordering in your path configurations, etc., to make sure the appropriate entry matches the right music.

> [@anotherhowie](#):
>
> How can I select that album to use “beet modify” and correct it?

Perhaps a path query would work? You can select music based on which directory it lives in. Or include the year as part of your query.

---

<div class="post-metadata">

### Author: ![anotherhowie](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/anotherhowie/32/215_2.png) [@anotherhowie](https://discourse.beets.io/u/anotherhowie)
#### Post date: [March 30, 2019, 6:10pm UTC](https://discourse.beets.io/t/paths-for-files-with-a-custom-field-present/683/3 "2019-03-30T18:10:04Z")

</div>

Aaah, thanks again Adrian. It was the order that was tripping me up. Also, the simpler `.` works fine, and is a little easier to read 🙂

I will give the pathname match a shot.
