NAME
Music::Tag::Amazon - Plugin module for Music::Tag to get information from Amazon.com
SYNOPSIS
use Music::Tag
my $info = Music::Tag->new($filename);
my $plugin = $info->add_plugin("Amazon");
$plugin->get_tag;
print "Record Label is ", $info->label();
DESCRIPTION
This plugin gathers additional information about a track from amazon, and updates the Music::Tag object.
Music::Tag::Amazon objects must be created by Music::Tag.
REQUIRED DATA VALUES
- artist
USED DATA VALUES
- asin
-
If the asin is set, this is used to look up the results instead of the artist name.
- album
-
This is used to filter results.
- releasedate
-
This is used to filter results.
- totaltracks
-
This is used to filter results.
- title
-
title is used only if track is not true, or if trust_title option is set.
- tracknum
-
tracknum is used only if title is not true, or if trust_track option is set.
SET DATA VALUES
- album
-
Album name is set if necessary.
- title
-
title is set only if trust_track is true.
- track
-
track is set only if track is not true or trust_title is true.
- picture
-
highres is tried, then medium-res, then low. If low-res is a gif, it gives up.
- asin
-
Amazon Store Identification Number
- label
-
Label of Album
- releasedate
-
Release Date
- upc
-
Universal Product Code.
- ean
-
European Article Number
- Amazon Optional Values
-
These values are filled out if the amazon_info option is true.
- amazon_salesrank
- amazon_description
- amazon_price
- amazon_listprice
- amazon_usedprice
- amazon_usedcount
OPTIONS
Music::Tag::Amazon accepts the following options:
- trust_title
-
Default false. When this is true, and a Music::Tag object's track number is different than the track number of the song with the same title in the Amazon listing, then the tagobject's tracknumber is updated. In other words, we trust that the song has accurate titles, but the tracknumbers may not be accurate. If this is true and trust_track is true, then trust_track is ignored.
- trust_track
-
Default false. When this is true, and a Music::Tag objects's title conflicts with the title of the corresponding track number on the Amazon listing, then the Music::Tag object's title is set to that of the track number on amazon. In other words, we trust that the track numbers are accurate in the Music::Tag object. If trust_title is true, this option is ignored.
- coveroverwrite
-
Default false. When this is true, a new cover is downloaded and the current cover is replaced. The current cover is only replaced if a new cover is found.
- token
-
Amazon Developer token. Change to one given to you by Amazon. REQUIRED OPTION.
- secret_key
-
Amazon Developer secret key. Change to one given to you by Amazon. REQUIRED OPTION.
- min_album_points
-
Default 10. Minimum number of points an album must have to win election.
- locale
-
Default us. Locale code for store to use. Valid are ca, de, fr, jp, uk or us as of now. Maybe more...
- amazon_info
-
Default false. Return optional info.
METHODS
- get_tag()
-
Updates current Music::Tag object with information from Amazon database.
- lwp()
-
Returns and optionally sets reference to underlying LWP user agent.
- amazon_cache()
-
Returns and optionally sets a reference to the Cache::FileCache object used to cache amazon requests.
- coverart_cache()
-
Returns and optionally sets reference to the Cache::FileCache object used to cache downloaded cover art.
- amazon_ua()
-
Returns and optionally sets reference to Net::Amazon object.
- default_options()
-
Returns the default options for the plugin.
- set_tag()
-
Not used by this plugin.
- required_values()
-
A list of required values required for get_tag() to work.
- set_values()
-
A list of values that can be set by this module.
METHODOLOGY
If the asin value is true in the Music::Tag object, then the lookup is done with this value. Otherwise, it performs a search for all albums by artist, and then waits each album to see which is the most likely. It assigns point using the following values:
Matches ASIN: 128 points
Matches UPC or EAN: 64 points
Full name match: 32 points
or close name match: 20 points
Contains name of track: 10 points
or title match: 8 points
Matches totaltracks: 4 points
Matches year: 2 points
Older than last match: 1 points
Highest album wins. A minimum of 10 points needed to win the election by default (set by min_album_points option).
Close name match means that both names are the same, after you get rid of white space, articles (the, a, an), lower case everything, translate roman numerals to decimal, etc.
BUGS
Does not do well with artist who have over 50 releases. Amazon sorts by most popular.
Multi Disc / Volume sets seem to be working now, but support is still questionable.
Please use github for bug tracking: http://github.com/riemann42/Music-Tag-Amazon/issues.
SEE ALSO
SOURCE
Source is available at github: http://github.com/riemann42/Music-Tag-Amazon.
AUTHOR
Edward Allen III <ealleniii _at_ cpan _dot_ org>
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.
COPYRIGHT
Copyright © 2007,2008,2010 Edward Allen III. Some rights reserved.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 830:
Non-ASCII character seen before =encoding in '©'. Assuming UTF-8