App-MusicExpo
view release on metacpan or search on metacpan
App-MusicExpo version 1.002001
==============================
App::MusicExpo creates a HTML table from a list of songs.
The default template (named index.tmpl here) looks like:
| Title | Artist | Album | Genre | Track | Year | Type |
|---------+---------+-----------------+---------+-------+------+------|
| Cellule | Silence | L'autre endroit | Electro | 01/09 | 2005 | FLAC |
where the title is a download link. If you have multiple files with the same
basename (such as C<cellule.flac> and C<cellule.ogg>), they will be treated
as two versions of the same file, so a row will be created with two download
links, one for each format.
lib/App/MusicExpo.pm view on Meta::CPAN
=head1 SYNOPSIS
use App::MusicExpo;
App::MusicExpo->run;
=head1 DESCRIPTION
App::MusicExpo creates a HTML table from a list of songs.
The default template looks like:
| Title | Artist | Album | Genre | Track | Year | Type |
|---------+---------+-----------------+---------+-------+------+------|
| Cellule | Silence | L'autre endroit | Electro | 01/09 | 2005 | FLAC |
where the type is a download link. If you have multiple files with the same
basename (such as C<cellule.flac> and C<cellule.ogg>), they will be treated
as two versions of the same file, so a row will be created with two download
links, one for each format.
# Caches to 'cache.db', and the download links point to /download/a.flac, /download/b.flac, /download/c.flac
musicexpo --cache 'cache.db' --prefix /download/ my/music/a.flac my/music/b.flac othermusic/c.flac
# Caches into /tmp/musicexpocache and uses directory/file.tmpl as template
musicexpo --cache /tmp/musicexpocache --template directory/file.tmpl my-music/*.mp3
=head1 DESCRIPTION
musicexpo creates a HTML table from a list of songs.
The default template looks like:
| Title | Artist | Album | Genre | Track | Year | Type |
|---------+---------+-----------------+---------+-------+------+------|
| Cellule | Silence | L'autre endroit | Electro | 01/09 | 2005 | FLAC |
where the title is a download link. If you have multiple files with the same
basename (such as C<cellule.flac> and C<cellule.ogg>), they will be treated
as two versions of the same file, so a row will be created with two download
links, one for each format.
t/App-MusicExpo.t view on Meta::CPAN
#!/usr/bin/perl -wT
use v5.14;
use warnings;
use Test::More tests => 46;
use Scalar::Util qw/looks_like_number/;
use Storable qw/thaw/;
BEGIN { use_ok('App::MusicExpo'); }
my %data = (
title => 'Cellule',
artist => 'Silence',
year => 2005,
album => 'L\'autre endroit',
tracknumber => 1,
t/App-MusicExpo.t view on Meta::CPAN
sub test {
my ($format, $sub, $file) = @_;
my ($ext) = $file =~ /(\..+)$/;
SKIP:
{
skip "Cannot handle $ext files (tag-reading module missing)", 9 unless $handled{$ext};
my $info = thaw $sub->($file);
is $info->{format}, $format, "$format format";
for (sort keys %data) {
my $op = looks_like_number $data{$_} ? '==' : 'eq';
cmp_ok $info->{$_}, $op, $data{$_}, "$format $_"
}
is $info->{file}, $file, "$format file";
}
}
test FLAC => \&App::MusicExpo::flacinfo, 'empty.flac';
test MP3 => \&App::MusicExpo::mp3info, 'empty3.mp3';
test Vorbis => \&App::MusicExpo::vorbisinfo, 'empty.ogg';
test AAC => \&App::MusicExpo::mp4info, 'empty4.aac';
( run in 0.422 second using v1.01-cache-2.11-cpan-64827b87656 )