Audio-DB

 view release on metacpan or  search on metacpan

DB/Reports.pm  view on Meta::CPAN

    
    # Add the year and totals
    $im->stringUp(gdTinyFont,$x1 + ((gdTinyFont->width * 1)/2),$y2+25,$year,$black);
    unless ($omit_totals) {
      $im->stringUp(gdTinyFont,$x1 + ((gdTinyFont->width * 1)/2),$y1-5,$total,$black);
    }
    $xoffset += $boxwidth;
    print STDERR join("\t",$year,$total,$x1,$y1,$x2,$y2),"\n" if DEBUG
  }

  my $string = $im->png;
  return $string;
}


=pod

=item $report->library_size()

Calculate the full size of your library. Returns a hash reference
containing the size in kilobytes (Kb), megabytes (MB), and the size in

bin/album_distribution.PLS  view on Meta::CPAN


# Create a new Audio::DB object...
my $report = Audio::DB::Reports->new(-adaptor => $adaptor,
				     -user    => $user,
				     -pass    => $pass,
				     -host    => $host,
				     -dsn     => $dsn);

my @foreground = split(",",$foreground);
my @background = split(",",$background);
my $png = $report->distribution(-class       => 'albums',
				-range       => ($start && $end) ? [$start..$end] : '',
				-width       => $width,
				-height      => $height,
				-background  => \@background,
				-foreground  => \@foreground,
				-omit_totals => $omit_totals,
			       );
print $png;

__END__

=pod

=head1 NAME

album_distribution - create a histogram of song distribution by year

=head1 SYNPOSIS

bin/song_distribution.PLS  view on Meta::CPAN


# Create a new Audio::DB object...
my $report = Audio::DB::Reports->new(-adaptor => $adaptor,
				     -user    => $user,
				     -pass    => $pass,
				     -host    => $host,
				     -dsn     => $dsn);

my @foreground = split(",",$foreground);
my @background = split(",",$background);
my $png = $report->distribution(-class       => 'songs',
				-range       => ($start && $end) ? [$start..$end] : '',
				-width       => $width,
				-height      => $height,
				-background  => \@background,
				-foreground  => \@foreground,
				-omit_totals => $omit_totals,
			       );
print $png;

__END__

=pod

=head1 NAME

song_distribution - create a histogram of song distribution by year

=head1 SYNPOSIS

bin/test_all.sh  view on Meta::CPAN

#!/bin/sh
DSN=$1
ADAPTOR=$2

mkdir tmp/
echo "Generating album histogram..."
./album_distribution.pl --dsn ${DSN} --adaptor ${ADAPTOR} --user root --pass root --width 1000 --height 600 -start 1940 -end 2004 > tmp/albums.png
echo "Generating song histogram..."
./song_distribution.pl --dsn ${DSN} --adaptor ${ADAPTOR} --user root --pass root --width 1000 --height 600 -start 1940 -end 2004  > tmp/songs.png 
echo "Finding artists with multiple genres assigned..."
./artists_with_multiple_genres.pl --dsn ${DSN} --adaptor ${ADAPTOR} --user root --pass root > tmp/artists_multiple_genres.out
echo "Generating full album list..."
./generate_album_list.pl --dsn ${DSN} --adaptor ${ADAPTOR} --user root --pass root > tmp/album_list.out
echo "Generating library statistics..."
./library_statistics.pl --dsn ${DSN} --adaptor ${ADAPTOR} --user root --pass root  > tmp/library_stats.out
echo "Finding albums that fall below bitrate threshold..."
./albums_below_threshold.pl --dsn ${DSN} --adaptor ${ADAPTOR} --user root --pass root -threshold 192 > tmp/albums_below_threshold.out
echo "Generating genre report..."
./genre_statistics.pl --dsn ${DSN} --adaptor ${ADAPTOR} --user root --pass root > tmp/genre_stats.out



( run in 1.260 second using v1.01-cache-2.11-cpan-df04353d9ac )