NAME
Music::Tag::File - Plugin module for Music::Tag to get information from filename and directory entries.
SYNOPSIS
use Music::Tag
my $filename = "/var/lib/music/artist/album/track.mp3";
my $info = Music::Tag->new($filename, { quiet => 1 });
$info->add_plugin("File");
$info->get_info();
# Following prints "artist"
print "Artist is ", $info->artist;
DESCRIPTION
Music::Tag::File is a Music::Tag plugin used to guess information about a music file from its filename, directory name, or contents of the directory it resides in.
This plugin will not overwrite values found by other plugins.
Music::Tag::File objects must be created by Music::Tag.
REQUIRED DATA VALUES
No values are required (except filename, which is usually provided on object creation).
SET DATA VALUES
- album
-
Derived from directory file is in.
- artist
-
Derived from parent directory of directory file is in.
- tracknum
-
Derived from first number(s) found in file name.
- track
-
Derived from filename with initial numbers removed.
- disc
-
Set to 1 of 1 if no value set.
- picture
-
Looks for folder.png, folder.jpg, or cover.jpg
- lyrics
-
Looks for file of same name as filename with .txt extension.
- booklet
-
Looks for any pdf file.
OPTIONS
- lyricsoverwrite
-
If true will overwrite lyrics with values found by plugin.
- coveroverwrite
-
If true will overwrite picture with values found by plugin.
- no_savelyrics
-
If true will not save lyrics.
- no_savecover
-
If true will not save cover.
METHODS
- default_options()
-
Returns the default options for the plugin.
- set_tag()
-
Saves info such as image files, lyrics, etc. Note: Currently calls save_lyrics method for all files that do not end in .mp3 unless np_savelyrics is set.
- get_tag()
-
Gathers info from file name, text files, etc.
- set_values()
-
A list of values that can be set by this module.
- saved_values()
-
A list of values that can be saved by this module.
- save_lyrics()
-
Save lyrics to a text file.
- save_cover()
-
Save cover picture to disk.
BUGS
This method of determining information about a music file is always unreliable unless great care is taken in file naming.
Please use github for bug tracking: http://github.com/riemann42/Music-Tag-File/issues.
SEE ALSO
SOURCE
Source is available at github: http://github.com/riemann42/Music-Tag-File.
AUTHOR
Edward Allen III <ealleniii _at_ cpan _dot_ org>
COPYRIGHT
Copyright © 2007,2010 Edward Allen III. Some rights reserved.
LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either:
a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or
b) the "Artistic License" which comes with Perl.
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 either the GNU General Public License or the Artistic License for more details.
You should have received a copy of the Artistic License with this Kit, in the file named "Artistic". If not, I'll be glad to provide one.
You should also have received a copy of the GNU General Public License along with this program in the file named "Copying". If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA or visit their web page on the Internet at http://www.gnu.org/copyleft/gpl.html.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 436:
Non-ASCII character seen before =encoding in '©'. Assuming UTF-8