# Costum field in config.yaml to define paths options

**URL:** <https://discourse.beets.io/t/costum-field-in-config-yaml-to-define-paths-options/371>\
**Category:** Help\
**Created:** [June 6, 2018, 9:38am UTC](https://discourse.beets.io/t/costum-field-in-config-yaml-to-define-paths-options/371 "2018-06-06T09:38:11Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![wa0815](https://avatars.discourse-cdn.com/v4/letter/w/8edcca/32.png) [@wa0815](https://discourse.beets.io/u/wa0815)\
**Post date:** [June 6, 2018, 9:38am UTC](https://discourse.beets.io/t/costum-field-in-config-yaml-to-define-paths-options/371/1 "2018-06-06T09:38:11Z")

</div>

Hi,

I wonder if is possible to use custom fields to apply special path options in the configuration.

In my case there ist the custom field “homegrown” which can have the value “true”.

I added to the config.yaml

```
paths:
    default: $albumartist_credit/$album%aunique{}/$disc-$track $title
# default: $albumartist/$album%aunique{}/$disc-$track $title
    homegrown:true: homegrown/$albumartist/$album%aunique{}/$disc/$disctitle/$disc-$track $title

```

I also tried just as it works with singleton for example:

homegrown: homegrown/$albumartist/$album%aunique{}/$disc/$disctitle/$disc-$track $title

But this path option is ignored whent performing a

beet move -p “some search with homegrown=true”

The custom field “homegrown” is set on the album level

I’m afraid according this doc-page custom fields don’t work with paths-config:

[pathformat](http://beets.readthedocs.io/en/v1.3.17/reference/pathformat.html#syntax-details)

---

<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:** [June 6, 2018, 5:50pm UTC](https://discourse.beets.io/t/costum-field-in-config-yaml-to-define-paths-options/371/2 "2018-06-06T17:50:30Z")

</div>

Everything looks fine from here! Flexible attributes should work fine there. I don’t see an obvious problem.

---

<div class="post-metadata">

**Author:** ![wa0815](https://avatars.discourse-cdn.com/v4/letter/w/8edcca/32.png) [@wa0815](https://discourse.beets.io/u/wa0815)\
**Post date:** [June 6, 2018, 6:41pm UTC](https://discourse.beets.io/t/costum-field-in-config-yaml-to-define-paths-options/371/3 "2018-06-06T18:41:35Z")

</div>

Let’s test again

With now:

```
paths:
    # default: $albumartist_credit/$album%aunique{}/$disc-$track $title
    # default: $albumartist/$album%aunique{}/$disc-$track $title
        default: %asciify{$albumartist}/%asciify{$album}%aunique{}/$disc-$track %asciify{$title}
        homegrown:true: Homegrown/%asciify{$albumartist}/%asciify{$album}%aunique{}/$disc-$track %asciify{$title}
        album:Leonard Bernstein Collection Volume One: %asciify{$albumartist_credit}/%asciify{$album}%aunique{}/$disc/%asciify{$disctitle}/$disc-$track %asciify{$title}
        singleton: Non-Album/%asciify{$artist}/%asciify{$title}
        comp: Compilations/%asciify{$album}%aunique{}/$disc-$track %asciify{$title}

```

I choose this example files  
(homegrown is set on the album level, but it is also visible with each track)

```
beet ls Wolfgang Dauner -f '$homegrown $path'
true /marvin/mucke/beetOutput/_/Wolfgang_Dauner__Piano_solo_Köln_Subway/00-01_Wendekreis_des_Steinbocks.flac
true /marvin/mucke/beetOutput/_/Wolfgang_Dauner__Piano_solo_Köln_Subway/00-02_Don_t_change_me.flac
true /marvin/mucke/beetOutput/_/Wolfgang_Dauner__Piano_solo_Köln_Subway/00-03_Über_den_Dächern_von_Stuttgart.flac
true /marvin/mucke/beetOutput/_/Wolfgang_Dauner__Piano_solo_Köln_Subway/00-04_Trans_Tanz.flac

```

Now I use ‘move -p’ and the default rule is applied instead:

```
beet move -p /marvin/mucke/beetOutput/_/Wolfgang_Dauner__Piano_solo_Köln_Subway/
    Moving 4 items.
    /marvin/mucke/beetOutput/_/Wolfgang_Dauner__Piano_solo_Köln_Subway/00-01_Wendekreis_des_Steinbocks.flac 
      -> /marvin/mucke/beetOutput/Wolfgang_Dauner/Wolfgang_Dauner__Piano_solo_Koln_Subway/00-01_Wendekreis_des_Steinbocks.flac
    /marvin/mucke/beetOutput/_/Wolfgang_Dauner__Piano_solo_Köln_Subway/00-02_Don_t_change_me.flac 
      -> /marvin/mucke/beetOutput/Wolfgang_Dauner/Wolfgang_Dauner__Piano_solo_Koln_Subway/00-02_Don_t_change_me.flac
    /marvin/mucke/beetOutput/_/Wolfgang_Dauner__Piano_solo_Köln_Subway/00-03_Über_den_Dächern_von_Stuttgart.flac 
      -> /marvin/mucke/beetOutput/Wolfgang_Dauner/Wolfgang_Dauner__Piano_solo_Koln_Subway/00-03_Uber_den_Dachern_von_Stuttgart.flac
    /marvin/mucke/beetOutput/_/Wolfgang_Dauner__Piano_solo_Köln_Subway/00-04_Trans_Tanz.flac 
      -> /marvin/mucke/beetOutput/Wolfgang_Dauner/Wolfgang_Dauner__Piano_solo_Koln_Subway/00-04_Trans_Tanz.flac

```

I use the beets which comes with debian stable:  
beets version 1.3.18  
plugins: chroma, convert, edit, embedart, lastgenre, mbsync, smartplaylist, web

What could I do to check it better ?

---

<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:** [June 6, 2018, 6:54pm UTC](https://discourse.beets.io/t/costum-field-in-config-yaml-to-define-paths-options/371/4 "2018-06-06T18:54:25Z")

</div>

Try setting it on the track level. Path queries don’t work with album-level fields: [https://github.com/beetbox/beets/issues/2797](https://github.com/beetbox/beets/issues/2797)

---

<div class="post-metadata">

**Author:** ![wa0815](https://avatars.discourse-cdn.com/v4/letter/w/8edcca/32.png) [@wa0815](https://discourse.beets.io/u/wa0815)\
**Post date:** [June 6, 2018, 8:21pm UTC](https://discourse.beets.io/t/costum-field-in-config-yaml-to-define-paths-options/371/5 "2018-06-06T20:21:29Z")

</div>

Ok, thanks for the link to the issue.

For my “requirements” I’m going to solve the path naming by using albumartist again instead of albumartist\_credit. So there is no urgent to create a parent directory “homegrown” any more (to avoid the ‘\_’ due to the empy albumartist\_credit with no-musicbrainz (homegrown) releases.

A few month ago I switched to albumartist\_credit to avoid artist directories on base of non-latin artist names.

* * *

Finally another hint: it doesn’t work with a non-path query either:

```
beet move -p Wolfgang Dauner Piano solo
Moving 4 items.
/marvin/mucke/beetOutput/_/Wolfgang_Dauner__Piano_solo_Köln_Subway/00-01_Wendekreis_des_Steinbocks.flac 
  -> /marvin/mucke/beetOutput/Wolfgang_Dauner/Wolfgang_Dauner__Piano_solo_Koln_Subway/00-01_Wendekreis_des_Steinbocks.flac
/marvin/mucke/beetOutput/_/Wolfgang_Dauner__Piano_solo_Köln_Subway/00-02_Don_t_change_me.flac 
  -> /marvin/mucke/beetOutput/Wolfgang_Dauner/Wolfgang_Dauner__Piano_solo_Koln_Subway/00-02_Don_t_change_me.flac
/marvin/mucke/beetOutput/_/Wolfgang_Dauner__Piano_solo_Köln_Subway/00-03_Über_den_Dächern_von_Stuttgart.flac 
  -> /marvin/mucke/beetOutput/Wolfgang_Dauner/Wolfgang_Dauner__Piano_solo_Koln_Subway/00-03_Uber_den_Dachern_von_Stuttgart.flac
/marvin/mucke/beetOutput/_/Wolfgang_Dauner__Piano_solo_Köln_Subway/00-04_Trans_Tanz.flac 
  -> /marvin/mucke/beetOutput/Wolfgang_Dauner/Wolfgang_Dauner__Piano_solo_Koln_Subway/00-04_Trans_Tanz.flac
```

---

<div class="post-metadata">

**Author:** ![wa0815](https://avatars.discourse-cdn.com/v4/letter/w/8edcca/32.png) [@wa0815](https://discourse.beets.io/u/wa0815)\
**Post date:** [June 7, 2018, 11:48am UTC](https://discourse.beets.io/t/costum-field-in-config-yaml-to-define-paths-options/371/6 "2018-06-07T11:48:18Z")

</div>

Finally I can confirm now:  
Setting the attribute on the track level as well worked (while setting it tracks where moved accordingly !) .

Thanks again for the hint !

---

<div class="post-metadata">

**Author:** ![wa0815](https://avatars.discourse-cdn.com/v4/letter/w/8edcca/32.png) [@wa0815](https://discourse.beets.io/u/wa0815)\
**Post date:** [June 7, 2018, 11:56am UTC](https://discourse.beets.io/t/costum-field-in-config-yaml-to-define-paths-options/371/7 "2018-06-07T11:56:55Z")

</div>

While moving all those dirs/tracks beets didn’t move the external cover art “cover.jpg”.  
Do I have to configure a special option for that ?

---

<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:** [June 7, 2018, 1:34pm UTC](https://discourse.beets.io/t/costum-field-in-config-yaml-to-define-paths-options/371/8 "2018-06-07T13:34:07Z")

</div>

You will need `fetchart` enabled to pick up those files, but otherwise it should work out of the box.

---

<div class="post-metadata">

**Author:** ![wa0815](https://avatars.discourse-cdn.com/v4/letter/w/8edcca/32.png) [@wa0815](https://discourse.beets.io/u/wa0815)\
**Post date:** [June 7, 2018, 3:41pm UTC](https://discourse.beets.io/t/costum-field-in-config-yaml-to-define-paths-options/371/9 "2018-06-07T15:41:18Z")

</div>

I’m not shure if I got it correctly.  
“otherwise it should work out of the box”, even with fetchart disabled ?

I’m not using to select and provide pictures by myself .

My config isn’t very sophisticated:

```
paths:
    default: $albumartist/$album%aunique{}/$disc-$track $title
    homegrown:true: Homegrown/$albumartist/$album%aunique{}/$disc-$track $title
    album:Leonard Bernstein Collection Volume One: $albumartist_credit/$album%aunique{}/$disc/$disctitle/$disc-$track $title
    singleton: Non-Album/$artist/$title
    comp: Compilations/$album%aunique{}/$disc-$track $title
convert:
    dest: ~/converted_music
    copy_album_art: yes
    formats:
        mp3: ffmpeg -i $source -acodec libmp3lame -b:a 320k $dest
        alac:
            command: ffmpeg -i $source -y -vn -acodec alac $dest
            extension: m4a
        aac:
            command: ffmpeg -i $source -y -vn -acodec libfaac -aq 100 $dest
            extension: m4a
        opus: ffmpeg -i $source -y -vn -acodec libopus -ab 96k $dest
        flac: ffmpeg -i $source -y -vn -acodec flac $dest
        ogg: ffmpeg -i $source -y -vn -acodec libvorbis -aq 3 $dest
        wma: ffmpeg -i $source -y -vn -acodec wmav2 -vn $dest
    never_convert_lossy_files: no
    album_art_maxwidth: 0
    format: mp3
    auto: no
    threads: 4
    tmpdir:
    max_bitrate: 500

    paths: {}
    pretend: no
    quiet: no
    embed: yes
log: /marvin/mucke/beet.log
smartplaylist:
    relative_to: /marvin/mucke/beetOutput
    playlist_dir: ~/playlists
    playlists: [{query: 'genre::[Cc]lass|[Kk]lass|Barock|Chamber|Choral|Chorus|Gitarre|Guitar|Klavier|Medieval|Oper|Orchest|Renaiss', name: klassik.m3u}]
    auto: yes
chroma:
    auto: no
embedart:
    auto: no
    compare_threshold: 0
    ifempty: no
    remove_art_file: no
    maxwidth: 0

replace:
    ' ': _
    '[\\/]': _
    ^\.: _
    '[\x00-\x1f]': _
    '[<>:"\?\*\|;,\.]': _
    '[\(\)]': __
    \.$: _
    \s+$: ''
    ^\s+: ''
    '&': _
    \': _
    "\\\u2019": _
languages: en de es
edit:
    albumfields: album albumartist genre
    itemfields: track title artist album
    ignore_fields: id path
lastgenre:
    auto: yes
    whitelist: ~/.config/beets/whitelist.yaml
    canonical: ~/.config/beets/genres-tree.yaml
    force: no
    count: 1
    source: album
    min_weight: 10
    separator: ', '
    fallback:

plugins: convert smartplaylist mbsync chroma embedart web lastgenre edit
directory: /marvin/mucke/beetOutput

import:
    languages: de en
    media: CD
acoustid:
    apikey: REDACTED
per_disc_numbering: yes
web:
    host: 127.0.0.1
    port: 8337
    cors: ''
```

---

<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:** [June 7, 2018, 4:02pm UTC](https://discourse.beets.io/t/costum-field-in-config-yaml-to-define-paths-options/371/10 "2018-06-07T16:02:48Z")

</div>

Sorry for the ambiguity. You _will_ need that plugin enabled.

In the future, please use code blocks (instead of quotes) for your config so they stay readable.

---

<div class="post-metadata">

**Author:** ![wa0815](https://avatars.discourse-cdn.com/v4/letter/w/8edcca/32.png) [@wa0815](https://discourse.beets.io/u/wa0815)\
**Post date:** [June 7, 2018, 4:25pm UTC](https://discourse.beets.io/t/costum-field-in-config-yaml-to-define-paths-options/371/11 "2018-06-07T16:25:54Z")

</div>

Thank you again for clarifying.

I’m going to try it with a restrictive configurartion

> fetchart:  
> cautious: yes  
> minwidth: 500  
> maxwidth: 1000  
> cover\_names: cover  
> auto: no  
> sources: filesystem  
> google\_engine: 001442825323518660753:hrh5ch1gjzm  
> enforce\_ratio: no  
> store\_source: no  
> google\_key: REDACTED  
> fanarttv\_key: REDACTED
