DragonFly On-Line Manual Pages
MP3LINTRC(5) User Contributed Perl Documentation MP3LINTRC(5)
NAME
mp3lintrc - configuration file for mp3lint
SYNOPSIS
/etc/mp3lintrc, $HOME/.mp3lintrc
DESCRIPTION
mp3lint can be configured using the file .mp3lintrc in your home
directory.
The config file .mp3lintrc is actually a fragment of perl, so you can
put any valid perl code in there. Don't worry if you don't know perl,
you don't need to write any actual code. The best thing to do is work
your way through, altering the existing statements. Make sure every
(non-blank) line ends with a semicolon (;).
.mp3lintrc is automatically created the first time you run mp3lint.
If you use MP3::Archive(3) with any other tool than mp3lint, eg some of
the tools in mp3-archive-tools(1), you will have a configuration in
.mp3archiverc that you may wish to share with mp3lint. To do this,
either delete the non mp3lint-specific parts of .mp3lintrc (the first
half, up to the comment about mp3lint) and replace them with:
require "$ENV{HOME}/.mp3archiverc"
or do it the other way round, and replace all the contents of
.mp3archiverc with:
require "$ENV{HOME}/.mp3lintrc";
MP3::Archive will ignore any variables it doesn't know about. For more
details, see MP3::Archive::Config(3).
FORMATS
Formats are used to define valid filenames and to specify where the
artistname, albumname, etc are located.
Formats are regular expressions (see perlretut(1) and perlre(1)), but
with ARTIST, ALBUM, TRACK, TRKNUM and EXT as placeholders for the
artist, album, track name (song title), track number and file extension
respectively.
If you don't know about regular expressions, don't worry, treat them
like regular strings, but put a backslash (\) before any characters
other than letters, numbers and spaces (especially forward slash (/)
and period (.)).
There are two types of formats.
Variables beginning with $formats_ are lists of permissible formats for
parsing a filename, each of which are regular expressions (see
perlretut(1) and perlre(1) for details). The formats are references to
arrays, which essentially you can have as many as you want, separated
by commas, and they must start and end with [ and ] respectively. The
individual formats should be quoted with single quotes (').
Variables beginning with $format_ are single formats that are ordinary
strings, not regular expressions, and are used when creating filenames.
They don't have [ and ] round them, but still should be quoted with
single quotes ('), and there should be only one of them, not a list.
Examples
These are from the default setup.
$formats_album=['TRKNUM - ARTIST - ALBUM - TRACK\.EXT',
'ARTIST - ALBUM - TRKNUM - TRACK\.EXT'];
This defines two acceptable formats for album tracks. The first one
would match eg:
01 - Talk Talk - Spirit Of Eden - The Rainbow.mp3
and the second one would match eg:
DJ Shadow - Endtroducing - 07 - Stem-Long Stem.mp3
$formats_track=['ARTIST - TRACK\.EXT'];
This defines one acceptable format for non-album tracks. This would
match eg:
Radiohead - Paranoid Android (Live at the 10 Spot).ogg
$format_write_album='TRKNUM - ARTIST - ALBUM - TRACK.EXT';
This can be though of as the reverse of $formats_album. It defines the
format to be used when creating a file, so in this example, given
TRKNUM "02", ARTIST "Dead Can Dance", ALBUM "Aion", TRACK "Saltarello",
and EXT "wav", it would produce the filename:
02 - Dead Can Dance - Aion - Saltarello.wav
CONFIGURATION VARIABLES
Start with the default .mp3lintrc, which will be created for you when
you run mp3lint. Work your way through top to bottom. The file is
parsed as perl code, but you should be able to get by without knowing
any perl. Lines which start with # are comments, and can be ignored.
Non-blank lines should end with ;. The last line of the file should be
"1;"
$formats_album
This specifies acceptable formats for album tracks.
Default:
$formats_album= ['TRKNUM - ARTIST - ALBUM - TRACK\.EXT'>, 'ARTIST - ALBUM - TRKNUM - TRACK\.EXT'];
See FORMATS for details.
$formats_track
This specifies acceptable formats for non-album tracks.
Default:
$formats_track=['ARTIST - TRACK\.EXT'];
See FORMATS for details.
$formats_album_dir
This specifies how to extract info from the directory of an album
track.
Default:
$formats_album_dir= ['ARTIST - ALBUM$','ARTIST\/ALBUM$'];
This would match
Spiritualised - Lazer Guided Melodies
or
Spiritualised/Pure Phase
both at the end of the pathname (The $ means match the end of the
line).
$formats_track_dir
This specifies how to extract info from the directory of a non-
album track.
Default:
$formats_track_dir= ['ARTIST$'];
This specifies the last portion of the pathname is the artist.
$formats_album_m3u, $formats_track_m3u
Specifies the format of m3u playlist filenames for album and non-
album tracks.
Default:
$formats_album_m3u= ['ARTIST - ALBUM\.EXT'];
$formats_track_m3u = ['ARTIST\.EXT'];
$format_default
This is how to treat files that aren't in any of the defined
pathnames (see $paths_track and $paths_album below). It can be
either "album", to treat them as album tracks, "track" to treat
them as non-album tracks, or anything else (eg "skip") to ignore
them.
Default:
$format_default="skip";
$format_delimiter_album, $format_delimiter_track
These specify the delimiters for album and non-album tracks. This
allows extra checks, eg to make sure there are the right number of
fields (eg, if the delimiter is `-' and you have a track named
Stem - Long Stem, so the file is called
07 - DJ Shadow - Entroducing - Stem - Long Stem.mp3
then the extra dash will cause you problems, but specifying a
delimiter will allow mp3lint to determine there are too many
fields.
Default:
$format_delimiter_album= ' - ';
$format_delimiter_track= ' - ';
$paths_album, $paths_track
These are used to determine from its pathname whether a file should
be treated as part of an album. They are regular expressions, so
the same warnings about quoting apply as to formats. This also
means that they are substring matches, so the defaults below match
any pathname that contains a component containing album or track.
Although there is only one path each in the default, they can be
lists of multiple paths (or portions of paths) to match.
Default:
$paths_album=['album'];
$paths_track=['track'];
This means that any pathname containing album or track will be
treated accordingly (eg /music/groovy-albums/).
$archive_root
$archive_root is currently only used to define the $path_write_*
variables (below), but its use may be expanded in the future.
Default:
$archive_root="$ENV{HOME}/music";
On any sane unix system, $ENV{HOME} expands to your home directory.
$path_write_album, $path_write_track
$path_write_album and $path_write_track are used to determine the
canonical pathname for files, for tools like movemusic(1).
The defaults are defined relative to $archive_root (see above).
Defaults:
$path_write_album="$archive_root/cut/albums/";
$path_write_track="$archive_root/tracks/";
$format_write_album, $format_write_track, $format_write_album_m3u,
$format_write_track_m3u, $format_write_album_dir,
$format_write_track_dir
These variables are analogous to the $formats_* variables above,
but they are used for constructing filenames rather than parsing
them to extract information. They are not regular expressions, they
are ordinary strings, and there is only one of each rather than a
list (array). The same magic variables ("TRKNUM", "ARTIST",
"ALBUM", "TRACK") are used and are replaced with the actual data.
Defaults:
$format_write_album='TRKNUM - ARTIST - ALBUM - TRACK.EXT';
$format_write_track='ARTIST - TRACK.EXT';
$format_write_album_m3u='ARTIST - ALBUM.EXT';
$format_write_track_m3u='ARTIST.EXT';
$format_write_album_dir="/ARTIST/ALBUM/";
$format_write_track_dir="/ARTIST/";
Variables below this point are specific to mp3lint, not shared with
MMPP33::::AArrcchhiivvee.
$lint_extensions
These are the filename extensions mp3lint looks for. There is not
much point adding entries without implementing corresponding tools,
unless you have weird extensions for your files you want it to
find, but if you wanted to completely ignore a certain type of
file, you could remove it from the list.
Default:
$lint_extensions= ["mp3","mp2","wav","ogg","m3u","flac","au"];
$lint_various
If the pathname contains this, no warning is issued if the filename
and directory name disagree on the artist. This allows for multi-
artist compilations.
Default:
$lint_various='\/Various\/';
$lint_fix
Whether to attempt to fix problems as we find them. Currently only
fixes permissions. This can also be enabled with the -f flag to
mp3lint.
Default:
$lint_fix=0;
ie no.
$lint_skip
A series of regular expressions (see perlretut(1) and perlre(1)) of
messages to skip printing. This can be used to permanently suppress
messages you don't want to see. For a more complex system of
suppressing messages on a per-file basis, see mp3lintskip(1).
The default skip messages suppress the most pedantic of the error
messages. To enable all messages, change the line in your
.mp3lintrc that mentions $lint_skip to:
$lint_skip=[];
Default:
$lint_skip=["^filename:caps:", "^filename:the:", "^filename:disc:"];
$lint_case
Controls filename capitalisation style (in filename:caps test).
This variable only applies if Text::Autoformat is installed.
Default:
$lint_case="highlight";
Available values:
highlight
Capitalises everything except "unimportant" words. This is the
default.
title
Capitalises every word.
sentence
Capitalises the first word.
upper
Uppercases everything.
lower
Lowercases everything.
$lint_perms_file, $lint_perms_dir
Specifies the correct permissions for files and directories. For
more details, see the section in mp3lint-tools(1) on the tool
filesys, test perms.
Default:
$lint_perms_file=0644;
$lint_perms_dir=0755;
The default allows any user to play your music, but only you to
write to it.
$lint_minbitrate_mp3
Minimum bitrate for mp3 files. You may wish to allow a little
leeway, to allow for VBR files that average just under the target.
This is why the default is 120kbps not 128kbps.
Default:
$lint_minbitrate_mp3=120;
$lint_minbitrate_ogg
Minimum bitrate for ogg vorbis files. The default average bitrate
of files created by oggenc is 110kbps, so we allow a leeway of
10kbps in the default.
Default:
$lint_minbitrate_ogg=100;
$lint_minsamplerate
The minimum sample rate in Hz. The default is 44100, which is CD
quality.
Default:
$lint_minsamplerate=44100;
$lint_minbitsize
The minimum bit size of the sample. Most decent sounding samples
are at least 16 bit.
Default:
$lint_minbitsize=16;
$lint_allow_wav
Whether to check wav files or just complain about their presence.
This is useful if your only use for wav files is as part of the
ripping process, so if mp3lint finds one it probably means your
ripper died and left wavs lying about.
Default:
$lint_allow_wav=1;
This means to check wav files as normal.
$lint_maxbadframes_mp3info, $lint_maxbadframes_mp3check
Maximum bad frames accepted before we complain. May be useful
because sometimes we get false errors from mp3info or mp3check due
to iffy handling of ID3v2 tags. Different values can be set for
mp3info and mp3check. The default allows no bad frames.
Default:
$lint_maxbadframes_mp3check=0;
$lint_maxbadframes_mp3info=0;
ENVIRONMENT
$MP3LINTRC
If set, uses this instead of $HOME/.mp3lintrc
$HOME
Used to find .mp3lintrc
BUGS
None known. Please report any found to ianb@nessie.mcc.ac.uk
I am especially interested in how well the code for filename formats
works for other people's filenames.
SEE ALSO
mp3lint(1), mp3lintskip(1), mp3lintsum(1), mp3lint-tools(1),
MP3::Archive(3), MP3::Archive::Config(3), mp3-archive-tools(1)
AUTHOR
Ian Beckwith <ianb@nessie.mcc.ac.uk>
COPYRIGHT
Copyright 2003 Ian Beckwith <ianb@nessie.mcc.ac.uk>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.
perl v5.20.3 2003-12-14 MP3LINTRC(5)