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

Music::Tag::Amazon is normally created in Music::Tag. This plugin gathers additional information about a track from amazon, and updates the tag object.

REQUIRED VALUES

artist

USED 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 VALUES

album
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
label
releasedate

OPTIONS

Music::Tag::Amazon accepts the following options:

quiet

Setting to true turns off status messages.

verbose

Setting to true increases verbosity.

trust_title

When this is true, and a 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

When this is true, and a tag objects's title conflicts with the title of the corresponding track number on the Amazon listing, then the 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 tag object. If trust_title is true, this option is ignored.

coveroverwrite

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.

amazon_ua

A Net::Amazon object. Used if you want to define your own options for Net::Amazon.

lwp_ua

A LWP::UserAgent object. Used if you want to define your own options.

amazon_cache

A cache object. Used by default Net::Amazon object to store results. A Cache::FileCache object by default.

coverart_cache

A cache object. Used to store coverart in. A Cache::FileCache object by default.

min_album_points

Minimum number of points an album must have to win election. Default 10.

locale

Locale code for store to use. Valid are ca, de, fr, jp, uk or us as of now. Maybe more...

METHODS

get_tag

Updates current 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.

amazon_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.

METHEDOLOGY

If the asin value is true in the 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:            64 pts
Full name match:         32 pts
 or close name match:    16 pts
Contains name of track:  10 pts
 or title match:         8 pts 
Matches totaltracks:     4 pts
Matches year:            2 pts
Older than last match:   1 pts

Highest album wins. A minimum of 10 pts 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.

SEE ALSO INCLUDED

Music::Tag, Music::Tag::File, Music::Tag::FLAC, Music::Tag::Lyrics, Music::Tag::M4A, Music::Tag::MP3, Music::Tag::MusicBrainz, Music::Tag::OGG, Music::Tag::Option

SEE ALSO

Net::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 terms of the Artistic License, distributed with Perl.

COPYRIGHT

Copyright (c) 2007,2008 Edward Allen III. Some rights reserved.