NAME
Net::iTMS::Album - Represents an album in the iTunes Music Store
SYNOPSIS
use Net::iTMS::Album;
my $album = Net::iTMS::Album->new($iTMS, $id);
print "Album: ", $album->title, "\n";
# $track will be a Net::iTMS::Song object
for my $track ($album->tracks) { # also $album->songs
print "\t ", $track->number, ": ", $track->title, "\n";
}
DESCRIPTION
Net::iTMS::Album represents an album in the iTMS and encapsulates the associated data. If a piece of information hasn't been fetched from the iTMS, it will transparently fetch and store it for later use before returning.
If any method, excepting id
and thumb
, is called, the information for the others will be fetched in the same request. This means, for these methods, the first call to one will have a time hit for the HTTP request, but subsequent calls won't.
Methods
- new($itms, $albumId)
-
The first argument must be an instance of Net::iTMS, the second an iTMS album ID.
Returns a blessed hashref (object) for Net::iTMS::Album.
- id
-
Returns the ID of the album (
albumId
). - title
- name
-
Returns the title of the album.
- artist
-
Returns a Net::iTMS::Artist object for the album's artist.
- genre
-
Returns a Net::iTMS::Genre object for the album's genre.
- cover
-
Returns a hashref with the keys
url
,width
, andheight
which are for the album's cover. - thumb
-
Returns a hashref with the keys
url
,width
, andheight
which are for the thumbnail of the album's cover. - path
-
Returns an arrayref of hashrefs representing the album's "path" in the iTMS. The hashrefs contain the name of the node in the path and the iTMS URL of that node.
- tracks
- songs
-
Returns an array or arrayref (depending on context) of Net::iTMS::Song objects representing the tracklist of the album (in order of track number).
LICENSE
Copyright 2004, Thomas R. Sibley.
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/2.0/ or send a letter to:
Creative Commons
559 Nathan Abbott Way
Stanford, California 94305, USA.
AUTHOR
Thomas R. Sibley, http://zulutango.org:82/
SEE ALSO
Net::iTMS, Net::iTMS::Song, Net::iTMS::Artist, Net::iTMS::Genre