# Modifying tags with flexible attributes

**URL:** <https://discourse.beets.io/t/modifying-tags-with-flexible-attributes/262>\
**Category:** Help\
**Created:** [January 3, 2018, 8:50pm UTC](https://discourse.beets.io/t/modifying-tags-with-flexible-attributes/262 "2018-01-03T20:50:39Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![pd6](https://avatars.discourse-cdn.com/v4/letter/p/7cd45c/32.png) [@pd6](https://discourse.beets.io/u/pd6)\
**Post date:** [January 3, 2018, 8:50pm UTC](https://discourse.beets.io/t/modifying-tags-with-flexible-attributes/262/1 "2018-01-03T20:50:39Z")

</div>

Hi!  
I’m trying to populate a (custom) tag field with the value of a flexible attribute. I’m using beets on Win10.  
In this specific case, I populated my library with playcounts from [last.fm](http://last.fm) which are stored within the attribute “play\_count”. But whenever I try to pass the “play\_count” value to another field by e.g.:

beet modify artist=$play\_count

it passes the string “$play\_count” to the field, instead of its value. How can I pass the actual value of the flexible attribute to a different field?

---

<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:** [January 3, 2018, 9:58pm UTC](https://discourse.beets.io/t/modifying-tags-with-flexible-attributes/262/2 "2018-01-03T21:58:24Z")

</div>

Hello! It’snot yet possible to do that, sadly. Please see:

> <https://github.com/beetbox/beets/issues/488>

---

<div class="post-metadata">

**Author:** ![pd6](https://avatars.discourse-cdn.com/v4/letter/p/7cd45c/32.png) [@pd6](https://discourse.beets.io/u/pd6)\
**Post date:** [January 4, 2018, 5:38pm UTC](https://discourse.beets.io/t/modifying-tags-with-flexible-attributes/262/3 "2018-01-04T17:38:27Z")

</div>

Ah thank you, that’s unfortunate to hear.  
Is there any workaround to add the playcounts to the files?

---

<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:** [January 4, 2018, 9:53pm UTC](https://discourse.beets.io/t/modifying-tags-with-flexible-attributes/262/4 "2018-01-04T21:53:16Z")

</div>

You can always try writing your own plugin!

---

<div class="post-metadata">

**Author:** ![pd6](https://avatars.discourse-cdn.com/v4/letter/p/7cd45c/32.png) [@pd6](https://discourse.beets.io/u/pd6)\
**Post date:** [January 5, 2018, 7:27pm UTC](https://discourse.beets.io/t/modifying-tags-with-flexible-attributes/262/5 "2018-01-05T19:27:17Z")

</div>

Too bad, that goes beyond my abilities 😕

Thank you anyway!

---

<div class="post-metadata">

**Author:** ![mattbarnicle](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/mattbarnicle/32/166_2.png) [@mattbarnicle](https://discourse.beets.io/u/mattbarnicle)\
**Post date:** [October 28, 2018, 1:44am UTC](https://discourse.beets.io/t/modifying-tags-with-flexible-attributes/262/6 "2018-10-28T01:44:08Z")

</div>

i have written a plugin to do this exact thing for my iTunes catalog. iTunes does not show the label tag and i like to see that. so i copy the data from the label tag to the composer tag on import. i wrote a plugin to do this. it could be easily modified to do what you want. i would be glad to share it.

---

<div class="post-metadata">

**Author:** ![Hexactly](https://avatars.discourse-cdn.com/v4/letter/h/6de8d8/32.png) [@Hexactly](https://discourse.beets.io/u/Hexactly)\
**Post date:** [May 5, 2019, 2:17pm UTC](https://discourse.beets.io/t/modifying-tags-with-flexible-attributes/262/7 "2019-05-05T14:17:07Z")

</div>

I’d be really happy to try your plugin @mattbarnicle  
Trying to write internal db fields such as ‘mood\_acoustic’ to the media file tag.

Thanks!

---

<div class="post-metadata">

**Author:** ![mattbarnicle](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/mattbarnicle/32/166_2.png) [@mattbarnicle](https://discourse.beets.io/u/mattbarnicle)\
**Post date:** [May 5, 2019, 5:03pm UTC](https://discourse.beets.io/t/modifying-tags-with-flexible-attributes/262/8 "2019-05-05T17:03:11Z")

</div>

Great! The code is hosted on Github. I think the examples I provided should explain how to use the plugin. But let me know if you need any help.

> **[mattbarnicle/beetsplug](https://github.com/mattbarnicle/beetsplug)**
>
> Various plugins for beets media organizer. Contribute to mattbarnicle/beetsplug development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![Hexactly](https://avatars.discourse-cdn.com/v4/letter/h/6de8d8/32.png) [@Hexactly](https://discourse.beets.io/u/Hexactly)\
**Post date:** [May 10, 2019, 2:44pm UTC](https://discourse.beets.io/t/modifying-tags-with-flexible-attributes/262/9 "2019-05-10T14:44:18Z")

</div>

Thanks a lot for the reply!  
I’ve tried to get it to work but keep on getting - KeyError: ‘mood\_acoustic’  
Trying these config lines:  
tagcopy:  
only\_empty\_tags: no  
copy\_tags: MD\_ACOUSTIC=mood\_acoustic
