};
}
+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 %data = (
+ format => 'Opus',
+ title => $info{TITLE},
+ artist => $info{ARTIST},
+ year => $info{DATE},
+ album => $info{ALBUM},
+ tracknumber => $info{TRACKNUMBER},
+ tracktotal => $info{TRACKTOTAL},
+ genre => $info{GENRE},
+ file => scalar fileparse $file
+ );
+
+ freeze \%data;
+}
+
my %info = (
'.flac' => \&flacinfo,
'.mp3' => \&mp3info,
'.mp4' => \&mp4info,
'.aac' => \&mp4info,
'.m4a' => \&mp4info,
+ '.opus' => \&opusinfo,
);
sub normalizer{
-#!/usr/bin/perl -wT
+#!/usr/bin/perl -w
use v5.14;
use warnings;
<tr><th>Title<th>Artist<th>Album<th>Genre<th>Track<th>Year<th>Type
<tbody>
<tr><td class="title"><a href="#silence-cellule" data-hash="#silence-cellule">Cellule</a><td class="artist">Silence<td class="album">L'autre endroit<td class="genre">Electro<td class="track">01/09<td class="year">2005<td class="formats"><a href="/music/empty.flac">FLAC</a> <a href="/music/empty.ogg">Vorbis</a>
+<tr><td class="title"><a href="#silence-cellule" data-hash="#silence-cellule">Cellule</a><td class="artist">Silence<td class="album">L'autre endroit<td class="genre">Electro<td class="track">01/09<td class="year">2005<td class="formats"><a href="/music/empty2.opus">Opus</a>
<tr><td class="title"><a href="#silence-cellule" data-hash="#silence-cellule">Cellule</a><td class="artist">Silence<td class="album">L'autre endroit<td class="genre">Electro<td class="track">01/09<td class="year">2005<td class="formats"><a href="/music/empty3.mp3">MP3</a>
<tr><td class="title"><a href="#silence-cellule" data-hash="#silence-cellule">Cellule</a><td class="artist">Silence<td class="album">L'autre endroit<td class="genre">Electro<td class="track">1/9<td class="year">2005<td class="formats"><a href="/music/empty4.aac">AAC</a>
</table>