User:PBryan/metatool

From MusicBrainz Wiki

metatool

Description

The metatool script manages the metadata of FLAC files in an album. It is used standalone by the user to edit an existing group of FLAC files, or is called by the cd2flac script to allow initial setting of metadata when extracting tracks from CD to FLAC format. This script sports the following notable features:

  • metadata common to all tracks is grouped into common album section for editing
  • automatically writes ALBUMARTIST tag when track artists differ from album artist
  • supports arbitrarily named and repeating tag names (e.g. performers in multiple separate PERFORMER tags)
  • moves featuring artist and track version information from track title into separate FEATURING and VERSION tags
  • moves disc number from release title into separate DISCNUMBER tag

Dependencies

Notes

  • This script is tested on Ubuntu 8.10; mileage may vary on other platforms.

Download

License

Usage

Usage: metatool [options] [album_dir]

Options

Option Description Default
--discid=id Disc ID to use for MusicBrainz lookup.
--[no]edit Edit the metadata prior to committing it. edit
--editor=program Program to use to edit metadata. vi
--input=type Input type (see below.) album
--help Display this help message.
--metaflac=program Program to use to get/set metadata in FLAC files metaflac
--outfile=path File to write output, if necessary
--output=type Output type (see below.) album
--quiet Quiet operation, no screen output.
---releaseid=id Release ID to use for MusicBrainz lookup.
---suppress=tag(s) List of tags to suppress in metadata.
--trackidtag=tag Name of tag in FLAC file to store track ID. MUSICBRAINZ_TRACKID
--tmp=directory Directory to store temporary files in. /tmp
--verbose Verbose output of progress information.

Editor

You will need to select editor command(s) that block until you complete editing the metadata file. After editing is complete, the file is read by metaedit to store into the FLAC file(s).

Input type

The --input option determines what the input for the metadata to edit. The choices are:

Type Description
album The specified (or current) directory of FLAC files is parsed.
musicbrainz MusicBrainz is queried using releaseid or discid.

Output type

The --output option determines what the output for the edited metadata is. The choices are:

Type Description
album The specified (or current) directory of FLAC files is written to.
cd2flac Raw metadata content output (intended only for use by cd2flac).

Tag suppression

You can instruct metatool to suppress specific tags from metadata editing by using the --suppress option. Specify tag names, separated by commas. Tag names are case-insensitive.

Configuration file

You can store persistent command-line options in a file called .metatool in your home directory. They will be read as defaults prior to processing any passed command-line options.

Changelog

0.24 (2009-03-24)

  • Added --[no]edit option to allow suppression of editing.
  • Added --releaseid option to specify specific release ID (and overrride disc ID).
  • Now stores artist name and artist sort name in tags for tracks and album.
  • Cleaner track version parsing from track title.

0.23 (2009-01-18)

  • Better handling of missing track numbers.
  • Retries failed queries to MusicBrainz.

0.22 (2009-01-11)

  • Added additional version keywords (acoustic, live).
  • Added --suppress option to specify tags to suppress.
  • Removed (unused) tag template functionality.

0.21 (2009-01-07)

  • Fixed usage information.

0.20 (2009-01-07)

  • Initial version released to MusicBrainz.