]> iEval git - app-musicexpo.git/blobdiff - lib/App/MusicExpo.pm
Bump version and update Changes
[app-musicexpo.git] / lib / App / MusicExpo.pm
index cf16468be168d69498b4ead9bec69d2a2b308925..c1433ca44c23566cf5ec4808f5c38a26930b9955 100644 (file)
@@ -3,7 +3,7 @@ use 5.014000;
 use strict;
 use warnings;
 
-our $VERSION = '0.006';
+our $VERSION = '1.001_001';
 
 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{
@@ -237,7 +259,7 @@ Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright (C) 2013-2015 by Marius Gavrilescu
+Copyright (C) 2013-2016 by Marius Gavrilescu
 
 This library is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself, either Perl version 5.14.2 or,
This page took 0.021595 seconds and 4 git commands to generate.