# Some albums moved under "\_" artist upon import

**URL:** <https://discourse.beets.io/t/some-albums-moved-under-artist-upon-import/835>\
**Category:** Help\
**Created:** [July 13, 2019, 11:12pm UTC](https://discourse.beets.io/t/some-albums-moved-under-artist-upon-import/835 "2019-07-13T23:12:58Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![indotoonster](https://avatars.discourse-cdn.com/v4/letter/i/d2c977/32.png) [@indotoonster](https://discourse.beets.io/u/indotoonster)\
**Post date:** [July 13, 2019, 11:12pm UTC](https://discourse.beets.io/t/some-albums-moved-under-artist-upon-import/835/1 "2019-07-13T23:12:59Z")

</div>

After importing my music collection into beets, I noticed that some albums end up getting imported under a folder with “\_” as the artist name, e.g.

```
/music
  /artist1
  /artist2
  /artist3
  /...
  /Various Artists
  /_ <-------------------
    /album1
    /album2

```

However, if I inspect with beet ls, I can see that the items there (e.g. album1 and album2 in the example above) contain the correct artist and albumartist tags.

Is this a known issue? and how can I fix this situation?

Any input greatly appreciated. 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:** [July 14, 2019, 2:01am UTC](https://discourse.beets.io/t/some-albums-moved-under-artist-upon-import/835/2 "2019-07-14T02:01:52Z")

</div>

Hmm… it’s hard to tell what’s going wrong at this high level of abstraction. Can you please include your configuration and the actual output of the `beet ls` command showing what’s going wrong?

---

<div class="post-metadata">

**Author:** ![indotoonster](https://avatars.discourse-cdn.com/v4/letter/i/d2c977/32.png) [@indotoonster](https://discourse.beets.io/u/indotoonster)\
**Post date:** [July 14, 2019, 6:18am UTC](https://discourse.beets.io/t/some-albums-moved-under-artist-upon-import/835/3 "2019-07-14T06:18:22Z")

</div>

Sorry for the lack of details. Here’s some more context.

Here is my config.yaml:

```
directory: /bigtank/audio/music
library: /bigtank/audio/beets_music.db
import:
  incremental_skip_later: yes
paths:
  comp: Various Artists/$album%aunique{}/$track - $artist - $title
  singleton: Non-Album/$artist_sort/$title
  default: $albumartist_sort/$album%aunique{}/$track - $title
plugins: chroma copyartifacts discogs fromfilename
chroma:
  auto: no
acoustid:
  apikey: <deleted>
copyartifacts:
    extensions: .*
    print_ignored: yes
discogs:
  user_token: <deleted>

```

Here is some output from `beet ls` for 1 album that is affected by this issue ([Prefab Sprout’s Steve McQueen acoustic recording](https://www.discogs.com/Prefab-Sprout-Steve-McQueen-Acoustic/release/13288548)). Approximately 2% of the albums I imported ended up this way (under “\_” artist):

```
$ beet ls -p album:"Steve McQueen"
/bigtank/audio/music/_/Steve McQueen Acoustic/01 - Appetite.mp3
/bigtank/audio/music/_/Steve McQueen Acoustic/02 - Bonny.mp3
/bigtank/audio/music/_/Steve McQueen Acoustic/03 - Desire As.mp3
/bigtank/audio/music/_/Steve McQueen Acoustic/04 - When Love Breaks Down.mp3
/bigtank/audio/music/_/Steve McQueen Acoustic/05 - Goodbye Lucille #1.mp3
/bigtank/audio/music/_/Steve McQueen Acoustic/06 - Moving The River.mp3
/bigtank/audio/music/_/Steve McQueen Acoustic/07 - Faron Young.mp3
/bigtank/audio/music/_/Steve McQueen Acoustic/08 - When The Angels.mp3

$ beet ls -f '$albumartist:$artist:$title' album:"Steve McQueen"
Prefab Sprout:Prefab Sprout:Appetite
Prefab Sprout:Prefab Sprout:Bonny
Prefab Sprout:Prefab Sprout:Desire As
Prefab Sprout:Prefab Sprout:When Love Breaks Down
Prefab Sprout:Prefab Sprout:Goodbye Lucille #1
Prefab Sprout:Prefab Sprout:Moving The River
Prefab Sprout:Prefab Sprout:Faron Young
Prefab Sprout:Prefab Sprout:When The Angels

```

Note that the second `beet ls` command verifies that beets understands the $artist and $albumartist fields is “Prefab Sprout”, but the import placed them under “/bigtank/audio/music/\_/”

---

<div class="post-metadata">

**Author:** ![indotoonster](https://avatars.discourse-cdn.com/v4/letter/i/d2c977/32.png) [@indotoonster](https://discourse.beets.io/u/indotoonster)\
**Post date:** [July 14, 2019, 6:30am UTC](https://discourse.beets.io/t/some-albums-moved-under-artist-upon-import/835/4 "2019-07-14T06:30:29Z")

</div>

Hmm, some added information. It looks like this _only_ happens on albums imported using metadata sourced from discogs:

```
$ beet ls -f '$albumartist:$path:$data_source' path:"/bigtank/audio/music/_/" data_source:Discogs | wc -l
1957
$ beet ls -f '$albumartist:$path:$data_source' path:"/bigtank/audio/music/_/" ^data_source:Discogs | wc -l
0

```

Note however, that there are some albums imported using metadata sourced from discogs that are not affected by this issue:

```
$ beet ls -f '$albumartist:$path:$data_source' ^path:"/bigtank/audio/music/_/" data_source:Discogs | wc -l
342
```

---

<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:** [July 14, 2019, 2:26pm UTC](https://discourse.beets.io/t/some-albums-moved-under-artist-upon-import/835/5 "2019-07-14T14:26:19Z")

</div>

I notice that your path format uses `$albumartist_sort`. Can you check whether that field is missing? (It’s likely to be missing in Discogs, which IIRC doesn’t provide this field.)

---

<div class="post-metadata">

**Author:** ![indotoonster](https://avatars.discourse-cdn.com/v4/letter/i/d2c977/32.png) [@indotoonster](https://discourse.beets.io/u/indotoonster)\
**Post date:** [July 14, 2019, 5:42pm UTC](https://discourse.beets.io/t/some-albums-moved-under-artist-upon-import/835/6 "2019-07-14T17:42:13Z")

</div>

Thanks, looks like that’s the issue. Indeed `$albumartist_sort` is empty for all these albums. What would your suggested fix be? I suppose I could use `beet modify` to manually populate these missing fields, but this would continue to happen for future imports. Where does `$albumartist_sort` usually get computed?

---

<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:** [July 14, 2019, 6:50pm UTC](https://discourse.beets.io/t/some-albums-moved-under-artist-upon-import/835/7 "2019-07-14T18:50:37Z")

</div>

It’s not automatically calculated—it comes from MusicBrainz, i.e., the blood, sweat, and tears of human volunteers who think carefully about what the sort name for an artist should be. 😃

You might consider using the artist name as a fallback, like `%if{$albumartist_sort,$albumartist_sort,$albumartist}`.

---

<div class="post-metadata">

**Author:** ![indotoonster](https://avatars.discourse-cdn.com/v4/letter/i/d2c977/32.png) [@indotoonster](https://discourse.beets.io/u/indotoonster)\
**Post date:** [July 21, 2019, 7:52am UTC](https://discourse.beets.io/t/some-albums-moved-under-artist-upon-import/835/8 "2019-07-21T07:52:03Z")

</div>

Thank you so much for the clarification about `$albumartist_sort` 😅  
I experimented with using fallbacks, but in the end decided that I didn’t want to compromise, having spent so much time on manually fixing lots of other metadata. So I’ve now come up with a workflow where I can extract such problematic cases, enter the correct `$albumartist_sort` field, and then modify the tags.

---

<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:** [July 21, 2019, 12:22pm UTC](https://discourse.beets.io/t/some-albums-moved-under-artist-upon-import/835/9 "2019-07-21T12:22:55Z")

</div>

Awesome!!

For what it’s worth, I sense an opportunity for a plugin to help with cases like this. A hypothetical plugin could “guess” sort names based on a few heuristics (e.g., move “The” to the end; if the name looks sort of like a first and last name, invert them) and then ask for human approval. It could even try to use MusicBrainz to look up sort names, even when the original match didn’t come from MB, just by searching for an artist with the given name. Could be cool!
