WWW::Discogs::Release - get music release information and images


WWW-Discogs documentation Contained in the WWW-Discogs distribution.

Index


Code Index:

NAME

Top

WWW::Discogs::Release - get music release information and images

METHODS

Top

title

returns the title

artists

returns a list of artist names

images

Returns a list of images

primary_images

Returns a list of the primary images

secondary_images

returns a list of the secondary images

styles

returns a list of styles

released

returns the date

tracklist

returns a list of tracks

extraartists

returns a list of artists

genres

returns a list of genre names

labels

returns a list of labels

country

Returns the country

formats

returns a list of formats

id

returns the discogs ID for the album

notes

returns a list of notes


WWW-Discogs documentation Contained in the WWW-Discogs distribution.
package WWW::Discogs::Release;

use strict;
use warnings;

sub new {
	my ($class, %opts) = @_;
	bless \%opts, $class;
}

sub title {
	my $self = shift;
	return $self->{title};
}

sub artists {
	my $self = shift;
	return @{ $self->{artists}{artist} };
}


sub images {
	my $self = shift;
	return @{ $self->{images}{image} };
}

sub primary_images {
	my $self = shift;
	return grep {$_->{type} eq 'primary'} @{$self->{images}{image}};
}

sub secondary_images {
	my $self = shift;
	return grep {$_->{type} eq 'secondary'} @{$self->{images}{image}};
}

sub styles {
	my $self = shift;
	if($self->{styles}{style} && ref($self->{styles}{style}) eq 'ARRAY')
	{
		return @{ $self->{styles}{style} };	
	}
	else
	{
		return $self->{styles}{style};
	}

}

sub released {
	my $self = shift;
	return $self->{released};
}

sub tracklist {
	my $self = shift;
	return @{ $self->{tracklist}{track} };
}

sub extraartists {
	my $self = shift;
	return @{ $self->{extraartists}{artist} };
}

sub genres {
	my $self = shift;
	return @{ $self->{genres}{genre} };
}

sub labels {
	my $self = shift;
	return @{ $self->{labels}{label} };
}


sub country {
	my $self = shift;
	return $self->{country};
}

sub formats {
	my $self = shift;
	return map {$_->{name}} @{$self->{formats}{format}};
}

sub id {
	my $self = shift;
	return $self->{id};
}

sub notes {
	my $self = shift;
	return @{ $self->{notes} };
}

1;