# Question about %\_multiartist%

**URL:** https://community.metabrainz.org/t/question-about-multiartist/451270
**Category:** MusicBrainz Picard
**Created:** [November 13, 2019, 7:50pm UTC](https://community.metabrainz.org/t/question-about-multiartist/451270 "2019-11-13T19:50:51Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![hbrtkp](https://community.metabrainz.org/user_avatar/community.metabrainz.org/hbrtkp/32/23585_2.png) [@hbrtkp](https://community.metabrainz.org/u/hbrtkp)
#### Post date: [November 13, 2019, 7:50pm UTC](https://community.metabrainz.org/t/question-about-multiartist/451270/1 "2019-11-13T19:50:51Z")

</div>

Hello

Maybe you’ll be able to help me with one thing. I’m using the following code. The case concerns `%_multiartist%`.

```auto
$num(%tracknumber%,2)). $if(%_multiartist%,%artist% - ,)$truncate(%title%,70)

```

`%_multiartist%` in compilations adds the artist name in the file name, for example:  
 ![obraz](https://community.metabrainz.org/uploads/default/original/3X/3/3/33c2f78ac9dfc8fd1694a90df56877ac46a191b9.png)

in single artist album `$if(%_multiartist%,%artist% - ,)` generates only track title without artist name:  
 ![obraz](https://community.metabrainz.org/uploads/default/original/3X/e/2/e245b06f562279b3b7d866bdb345c01b371af0f4.png)

And that’s fine, it’s just as I wanted. But there is problem with single artist albums with featered artist. The script generates file names with the artist:  
 ![obraz](https://community.metabrainz.org/uploads/default/original/3X/1/6/16457d367c093a168cc887fda487bc5a5d3d4d3e.png)

Is there any solution so that in this case (single artist album with feat) the artist is not added in the filename?

---

<div class="post-metadata">

### Author: ![outsidecontext](https://community.metabrainz.org/user_avatar/community.metabrainz.org/outsidecontext/32/90_2.png) [@outsidecontext](https://community.metabrainz.org/u/outsidecontext)
#### Post date: [November 14, 2019, 9:54pm UTC](https://community.metabrainz.org/t/question-about-multiartist/451270/2 "2019-11-14T21:54:08Z")

</div>

Not sure here, probably would need a plugin for proper handling. For me to understand: If it is either

- A single artist
- or multiple artists, but artists are marked as featuring

then you don’t want to include the artist name in the file name. In all other cases where there are multiple artists for the track you want them in the file name.

It’s a bit tricky, since one needs to exclude artists from the list based on the used join frame. If you are happy to exclude artists always if there is any featuring you could do:

```auto
$if($and(%_multiartist%,$not($in(%artist%,feat.))),%artist% - ,)

```

So this only prints the artist if it is multiartist and artist does not contain “feat.”. However, this would of course also not print the artist if it is e.g. “Artist 1 & Artist 2 (feat. Artist 3)” (two artists + one featuring).

Maybe somebody else has some clever idea. @rdswift has some plugin that helps with artist handling, but I think this does not help in this case.

---

<div class="post-metadata">

### Author: ![rdswift](https://community.metabrainz.org/user_avatar/community.metabrainz.org/rdswift/32/7032_2.png) [@rdswift](https://community.metabrainz.org/u/rdswift)
#### Post date: [November 14, 2019, 11:54pm UTC](https://community.metabrainz.org/t/question-about-multiartist/451270/3 "2019-11-14T23:54:08Z")

</div>

> [@outsidecontext](#):
>
> @rdswift has some plugin that helps with artist handling, but I think this does not help in this case.

Actually, it might. Try enabling the [Additional Artists Variables](https://picard.musicbrainz.org/plugins/) plugin ([instructions here](https://github.com/rdswift/picard-plugins/blob/2.0_RDS_Plugins/plugins/additional_artists_variables/docs/README.md)), and then changing your test from:

```auto
$if(%_multiartist%,%artist% - ,)

```

to:

```auto
$if($and(%_multiartist%,$or(%compilation%,%_artists_album_additional_id%)),%artist% - ,)

```

and see if that does what you want.

---

<div class="post-metadata">

### Author: ![hbrtkp](https://community.metabrainz.org/user_avatar/community.metabrainz.org/hbrtkp/32/23585_2.png) [@hbrtkp](https://community.metabrainz.org/u/hbrtkp)
#### Post date: [November 15, 2019, 8:15pm UTC](https://community.metabrainz.org/t/question-about-multiartist/451270/4 "2019-11-15T20:15:44Z")

</div>

@outsidecontext

> [@outsidecontext](#):
>
> For me to understand: If it is either
> 
> - A single artist
> - or multiple artists, but artists are marked as featuring
> 
> then you don’t want to include the artist name in the file name. In all other cases where there are multiple artists for the track you want them in the file name.

That’s correct. Your solution don’t work.

@rdswift

I know your plugin, i’m using it to create main artist folder (the first one artist). I did not expect it can be used in this situation, but it works!

Thank you guys for helping! Problem solved.

---

<div class="post-metadata">

### Author: ![rdswift](https://community.metabrainz.org/user_avatar/community.metabrainz.org/rdswift/32/7032_2.png) [@rdswift](https://community.metabrainz.org/u/rdswift)
#### Post date: [November 15, 2019, 8:24pm UTC](https://community.metabrainz.org/t/question-about-multiartist/451270/5 "2019-11-15T20:24:25Z")

</div>

> [@hbrtkp](#):
>
> I did not expect it can be used in this situation, but it works!

I never thought to use it for something like this either until I saw your question. Glad I could help. Thanks for letting me know.
