X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FApp%2FMusicExpo.pm;h=3f8bc42d80152cb8559d6770640cc87470eeb42b;hb=e2ce550b37beeeb7bac65d412b3f942e32cbd07a;hp=5b66bab875a222b234086ec0636b3f3d0c5991bc;hpb=60376c0c311eded06caad49aec2d485462ffbb8e;p=app-musicexpo.git diff --git a/lib/App/MusicExpo.pm b/lib/App/MusicExpo.pm index 5b66bab..3f8bc42 100644 --- a/lib/App/MusicExpo.pm +++ b/lib/App/MusicExpo.pm @@ -3,7 +3,7 @@ use 5.014000; use strict; use warnings; -our $VERSION = '1.000'; +our $VERSION = '1.001_000'; use Audio::FLAC::Header qw//; use HTML::Template::Compiled qw//; @@ -11,6 +11,7 @@ use Memoize qw/memoize/; use MP3::Info qw/get_mp3tag/; use Ogg::Vorbis::Header::PurePerl; use MP4::Info qw/get_mp4tag get_mp4info/; +use Audio::Opusfile qw//; use DB_File qw//; use Encode qw/encode/; @@ -111,6 +112,26 @@ sub mp4info{ }; } +sub opusinfo { + my $file = $_[0]; + my $of = Audio::Opusfile->new_from_file($file); + my $tags = $of->tags; + + my %data = ( + format => 'Opus', + title => $tags->query('TITLE'), + artist => $tags->query('ARTIST'), + year => $tags->query('DATE'), + album => $tags->query('ALBUM'), + tracknumber => $tags->query('TRACKNUMBER'), + tracktotal => $tags->query('TRACKTOTAL'), + genre => $tags->query('GENRE'), + file => scalar fileparse $file + ); + + freeze \%data; +} + my %info = ( '.flac' => \&flacinfo, '.mp3' => \&mp3info, @@ -119,6 +140,7 @@ my %info = ( '.mp4' => \&mp4info, '.aac' => \&mp4info, '.m4a' => \&mp4info, + '.opus' => \&opusinfo, ); sub normalizer{