X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FApp%2FMusicExpo.pm;h=c1433ca44c23566cf5ec4808f5c38a26930b9955;hb=17c8e5f607f576c8762858da54c8663e7d9bd7d0;hp=5eb5a6a840d427b16b8efebd2f442e6ca8f50815;hpb=3ae7eb15f60751bb36dcf6be01c7c4c997b3ba7c;p=app-musicexpo.git diff --git a/lib/App/MusicExpo.pm b/lib/App/MusicExpo.pm index 5eb5a6a..c1433ca 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.001_000'; +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/; @@ -113,23 +114,18 @@ sub mp4info{ sub opusinfo { my $file = $_[0]; - my %info; - my @info = `opusinfo \Q$file`; - return unless @info; - for (@info) { - chomp; - $info{$1} = $2 if /\s*([A-Z]+)=(.*)$/; - } + my $of = Audio::Opusfile->new_from_file($file); + my $tags = $of->tags; my %data = ( format => 'Opus', - title => $info{TITLE}, - artist => $info{ARTIST}, - year => $info{DATE}, - album => $info{ALBUM}, - tracknumber => $info{TRACKNUMBER}, - tracktotal => $info{TRACKTOTAL}, - genre => $info{GENRE}, + 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 );