# I want to insert %originalyear% into album title tag

**URL:** https://community.metabrainz.org/t/i-want-to-insert-originalyear-into-album-title-tag/509372
**Category:** MusicBrainz Picard
**Tags:** taggerscript
**Created:** [December 19, 2020, 4:25am UTC](https://community.metabrainz.org/t/i-want-to-insert-originalyear-into-album-title-tag/509372 "2020-12-19T04:25:03Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![TreyIII](https://community.metabrainz.org/letter_avatar_proxy/v4/letter/t/bc79bd/32.png) [@TreyIII](https://community.metabrainz.org/u/TreyIII)
#### Post date: [December 19, 2020, 4:25am UTC](https://community.metabrainz.org/t/i-want-to-insert-originalyear-into-album-title-tag/509372/1 "2020-12-19T04:25:03Z")

</div>

I thought it would be as easy as this:

%originalyear% $if($gt(%totaldiscs%,1),$if(%discnumber%,$set(album,%album% (Disc %discnumber%))))

I am missing something. I am new at this be gentle.  
For sorting purpose it needs to be in front.

---

<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: [December 19, 2020, 5:40am UTC](https://community.metabrainz.org/t/i-want-to-insert-originalyear-into-album-title-tag/509372/2 "2020-12-19T05:40:20Z")

</div>

Almost. You need to escape the parentheses around “Disc %discnumber%”. See the note under [Syntax](https://picard-docs.musicbrainz.org/en/extending/scripting.html#syntax) in the manual for more information.

Also, if it were me, I would replace your `%originalyear%` with `$if2(%originalyear%,0000)` which will insert “0000” if the `%originalyear%` tag is blank (which can and does happen if there is no release event with a date in the release group).

---

<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: [December 19, 2020, 6:29am UTC](https://community.metabrainz.org/t/i-want-to-insert-originalyear-into-album-title-tag/509372/3 "2020-12-19T06:29:09Z")

</div>

Is this for file naming script or for actually changing the tag? To change the tag you’ll need e.g.

```
$if(%originalyear%,$set(album,%originalyear% %album%))

```

Or to go with Rd swift’s suggestion to set it to 0000 if empty:

```
$set(album,$if2(%originalyear% ,0000 )%album%)
```

---

<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: [December 19, 2020, 6:50am UTC](https://community.metabrainz.org/t/i-want-to-insert-originalyear-into-album-title-tag/509372/4 "2020-12-19T06:50:27Z")

</div>

> [@outsidecontext](#):
>
> Is this for file naming script or for actually changing the tag?

Good question. I was too focused on the code snippet and completely missed the context.

---

<div class="post-metadata">

### Author: ![TreyIII](https://community.metabrainz.org/letter_avatar_proxy/v4/letter/t/bc79bd/32.png) [@TreyIII](https://community.metabrainz.org/u/TreyIII)
#### Post date: [December 19, 2020, 2:49pm UTC](https://community.metabrainz.org/t/i-want-to-insert-originalyear-into-album-title-tag/509372/5 "2020-12-19T14:49:48Z")

</div>

This is a tagger script, my idea for naming did work, easy. The field will not be blank because I will look it up and make it happen. I don’t want to do anything to the rest of the script, it works.  
I will try these suggestions.  
thank you

---

<div class="post-metadata">

### Author: ![TreyIII](https://community.metabrainz.org/letter_avatar_proxy/v4/letter/t/bc79bd/32.png) [@TreyIII](https://community.metabrainz.org/u/TreyIII)
#### Post date: [December 19, 2020, 2:55pm UTC](https://community.metabrainz.org/t/i-want-to-insert-originalyear-into-album-title-tag/509372/6 "2020-12-19T14:55:11Z")

</div>

This is a tagging script.

---

<div class="post-metadata">

### Author: ![TreyIII](https://community.metabrainz.org/letter_avatar_proxy/v4/letter/t/bc79bd/32.png) [@TreyIII](https://community.metabrainz.org/u/TreyIII)
#### Post date: [December 19, 2020, 5:12pm UTC](https://community.metabrainz.org/t/i-want-to-insert-originalyear-into-album-title-tag/509372/7 "2020-12-19T17:12:13Z")

</div>

TY outsidecontext the entire script works.

$if(%originalyear%,$set(album,%originalyear%%album%))$if($gt(%totaldiscs%,1),$if(%discnumber%,$set(album,%album% (Disc %discnumber%))))

The purpose for this is that media player will not sort by artist then year it is one or the other. I may someday want to see everything done in one year but not today.  
Having the year in the album title just works.  
I wish I had thought about this a long time ago, I have a lot of work to do.  
Thank You

**NOTE** to anyone that might copy and past that code the back slashes are not showing up at the end enter backslash **here** (Disc %discnumber% **here** ))))

---

<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: [December 20, 2020, 6:56pm UTC](https://community.metabrainz.org/t/i-want-to-insert-originalyear-into-album-title-tag/509372/8 "2020-12-20T18:56:20Z")

</div>

> NOTE to anyone that might copy and past that code the back slashes are not showing up at the end enter backslash here(Disc %discnumber%here))))

To get the backslashes to appear, you either have to escape them (double backslash) or include the line in a code block (preformatted text).
