# Set track field on import

**URL:** https://discourse.beets.io/t/set-track-field-on-import/1235
**Category:** Help
**Created:** [April 30, 2020, 6:08pm UTC](https://discourse.beets.io/t/set-track-field-on-import/1235 "2020-04-30T18:08:43Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![alebianco](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@alebianco](https://discourse.beets.io/u/alebianco)
#### Post date: [April 30, 2020, 6:08pm UTC](https://discourse.beets.io/t/set-track-field-on-import/1235/1 "2020-04-30T18:08:44Z")

</div>

Hi,  
I managed to import all my “good” albums with beets in a decent amount of time.  
The last let of my journey is to import the leftovers: albums with missing tracks or un-matchable info.

I’d like to do a first quick pass of them and then revisit those items later to refine the matches or re-source them.

Is it possible to set a flexible tag during import on the tracks in a way that they’ll be moved to a specific path?

I’ve tried with the --set flag but that seems to set the tag on the album and the path rule is not applied when moving the files.

Thanks for any suggestions!

---

<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: [May 1, 2020, 11:29am UTC](https://discourse.beets.io/t/set-track-field-on-import/1235/2 "2020-05-01T11:29:58Z")

</div>

Hello! Sounds like you’re running into the same problem as discussed in this thread:

> <https://github.com/beetbox/beets/issues/2797>
>
> Problem
> Path queries do not work with attributes that are set at album level. More specifically, I import an album setting at...

Unfortunately, there’s not a great solution yet. There is a PR offering a kind of fallback access for item-level attributes, but it has performance trade-offs that make it not a clear winner.

Would you be interested in weighing in there? Maybe somebody else has a better idea, or maybe it will spur action toward a simpler solution.

---

<div class="post-metadata">

### Author: ![alebianco](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@alebianco](https://discourse.beets.io/u/alebianco)
#### Post date: [May 1, 2020, 6:39pm UTC](https://discourse.beets.io/t/set-track-field-on-import/1235/3 "2020-05-01T18:39:09Z")

</div>

I checked the issue but I don’t think I know enough to have an opinion on that yet, I’ll have to spend some more time thinking about that.

In the mean time, is there a way, after the import, to add a tags on the fields that match an album query?

Just trying to find a way to finish importing the library in the appropriate paths so I can move on to phase two…

Thanks!

---

<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: [May 1, 2020, 9:10pm UTC](https://discourse.beets.io/t/set-track-field-on-import/1235/4 "2020-05-01T21:10:56Z")

</div>

Yeah, that would be a nice way to do it. I think one good option might be @kergoth’s `crossquery` plugin:

> **[kergoth/beets-kergoth](https://github.com/kergoth/beets-kergoth)**
>
> Personal collection of beets plugins. Contribute to kergoth/beets-kergoth development by creating an account on GitHub.

It lets you do stuff like this:

> <https://github.com/kergoth/beets-kergoth/blob/6e8bb043dba4aeac09b2c6faa1a96de5fa1aec66/beetsplug/crossquery.py#L10-L12>

So you could do `beet mod album_has:foo:bar foo=bar` to “propagate” album fields to item fields, hypothetically.

---

<div class="post-metadata">

### Author: ![alebianco](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@alebianco](https://discourse.beets.io/u/alebianco)
#### Post date: [May 2, 2020, 10:14am UTC](https://discourse.beets.io/t/set-track-field-on-import/1235/5 "2020-05-02T10:14:17Z")

</div>

Thanks for the tip!  
I managed to find a good workflow with another of the plugins from that repo:

```
modifyonimport:
  modify_album_items:
    bad:1:
      '': 'bad=1'

```

during import, if an album matches the “bad:1” query (which i set with the --set config option when launching the import) it sets bad=1 on all the items of said album. That way the path rules are applied as expected.

The plugin is a bit verbose on the console but I can manage for the few albums I’m left with
