After audio tagging, save only certain fields

Hi, newbie here to Picard scripting. I’m mainly using the program to use acoustic printing to find original release year and record label names for various files, many of which I’ve ripped from compilations and box sets. The acoustic procedure sends me back pretty much what I want, but way too much. It seems cumbersome to manually only save ORIGINALYEAR and LABEL/PUBLISHER.

Can I make a simple script that will only write those two retrived fields with the new values?

Your answer will help me get a glimpse into Picard syntax and I can go from there.

Thanks much.

1 Like

Before trying this: give it a thorough testing on a variety of copies of your music!

You could use a script like this, that will prevent Picard writing these specific tags.
I believe the list is complete and correct, and contains all tags that Picard could write, but I am not 100% sure.
(maybe somebody could confirm)

Make sure to remove the entries from this list that you do want updated/written.
(and obviously: make sure that under Options > Tags you do not have ‘clear existing tags’ checked)

$unset(album)
$unset(albumartist)
$unset(albumartistsort)
$unset(albumsort)
$unset(arranger)
$unset(artist)
$unset(artistsort)
$unset(artists)
$unset(bpm)
$unset(comment)
$unset(compilation)
$unset(composer)
$unset(composersort)
$unset(conductor)
$unset(copyright)
$unset(originaldate)
$unset(originalyear)
$unset(date)
$unset(discnumber)
$unset(totaldiscs)
$unset(encodedby)
$unset(encodersettings)
$unset(engineer)
$unset(genre)
$unset(grouping)
$unset(key)
$unset(isrc)
$unset(label)
$unset(language)
$unset(lyricist)
$unset(lyrics)
$unset(media)
$unset(mixer)
$unset(djmixer)
$unset(remixer)
$unset(mood)
$unset(originalalbum)
$unset(originalartist)
$unset(performer:*)
$unset(podcast)
$unset(podcasturl)
$unset(producer)
$unset(discsubtitle)
$unset(subtitle)
$unset(title)
$unset(titlesort)
$unset(tracknumber)
$unset(totaltracks)
$unset(work)
$unset(website)
$unset(license)
$unset(acoustid_id)
$unset(acoustid_fingerprint)
$unset(asin)
$unset(barcode)
$unset(catalognumber)
$unset(discid)
$unset(gapless)
$unset(musicbrainz_artistid)
$unset(musicbrainz_discid)
$unset(musicbrainz_originalalbumid)
$unset(musicbrainz_originalartistid)
$unset(musicbrainz_recordingid)
$unset(musicbrainz_albumid)
$unset(musicbrainz_albumartistid)
$unset(musicbrainz_releasegroupid)
$unset(musicbrainz_releasetrackid)
$unset(musicbrainz_trackid)
$unset(musicbrainz_trmid)
$unset(musicbrainz_workid)
$unset(musicip_puid)
$unset(musicip_fingerprint)
$unset(releasecountry)
$unset(releasestatus)
$unset(releasetype)
$unset(script)
$unset(show)
$unset(showsort)
$unset(writer)

And did I mention that before trying this: give it a thorough testing on a variety of copies of your music?

2 Likes

Thanks, this was a good start. If nothing else, it shrinks the list of fields on the bottom of my screen. It looks like my long list of comma separated fields in the “preserve” line.

The advantage of this approach is:

A. You have a better overview and it’s easier to edit, turn on/off etc.
B. You could have a script running before this one that gets processed first and may use some of these tags to create a new tag. After that first script has done it’s work, this second one will make sure all original tags are left alone and not updated.

1 Like

Is this script redundant after having all those fields in the “preserve” list? Would you scan the file, retrieve the tags, then run the script, then save?

I’m pretty sure the ‘preserve’ list trumps the script. So if you have all these tags in the ‘preserve’ field already, the script won’t do anything.

If you have the checkbox for the script ticked, it will run automatically. If not, you can run it manually by using right-click on a release/recording.

Gotcha, thanks. Figuring out scripting and the Picard user interface has been… interesting, to use a euphemism. But I did learn some stuff here.

@hiccup, thanks for your great answer. Followup question: is it possible to use wildcards with $unset?

For example, $unset(musicbrainz_*) instead of listing each one.

I’m pretty sure it’s not possible to do that with regular tags as in your example.
For as far as I know it will only work on multi-value tags, such as as e.g. performer:*

edit,
nope, definitely not possible, seems to be confirmed by two guys who should know :wink:

3 Likes