"cache:s" => \$cache,
);
-
-sub fix{
- my $copy = $_[0];
- utf8::decode($copy);
- $copy
-}
-
sub flacinfo{
my $file=$_[0];
my $flac=Audio::FLAC::Header->new($file);
freeze +{
format => 'FLAC',
- title => fix ($flac->tags('TITLE') // '?'),
- artist => fix ($flac->tags('ARTIST') // '?'),
- year => fix ($flac->tags('DATE') // '?'),
- album => fix ($flac->tags('ALBUM') // '?'),
- tracknumber => fix ($flac->tags('TRACKNUMBER') // '?'),
- tracktotal => fix ($flac->tags('TRACKTOTAL') // '?'),
- genre => fix ($flac->tags('GENRE') // '?'),
+ title => $flac->tags('TITLE') // '?',
+ artist => $flac->tags('ARTIST') // '?',
+ year => $flac->tags('DATE') // '?',
+ album => $flac->tags('ALBUM') // '?',
+ tracknumber => $flac->tags('TRACKNUMBER') // '?',
+ tracktotal => $flac->tags('TRACKTOTAL') // '?',
+ genre => $flac->tags('GENRE') // '?',
file => $file,
}
}
freeze +{
format => 'MP3',
- title => fix ($mp3->title || '?'),
- artist => fix ($mp3->artist || '?'),
- year => fix ($mp3->year || '?'),
- album => fix ($mp3->album || '?'),
- tracknumber => fix ($mp3->track1 || '?'),
- tracktotal => fix ($mp3->track2 || '?'),
- genre => fix ($mp3->genre) || '?',
+ title => $mp3->title || '?',
+ artist => $mp3->artist || '?',
+ year => $mp3->year || '?',
+ album => $mp3->album || '?',
+ tracknumber => $mp3->track1 || '?',
+ tracktotal => $mp3->track2 || '?',
+ genre => $mp3->genre || '?',
file => $file,
}
}
freeze +{
format => 'Vorbis',
- title => fix($ogg->comment('TITLE') || '?'),
- artist => fix ($ogg->comment('artist') || '?'),
- year => fix ($ogg->comment('DATE') || '?'),
- album => fix ($ogg->comment('ALBUM') || '?'),
- tracknumber => fix ($ogg->comment('TRACKNUMBER') || '?'),
- tracktotal => fix ($ogg->comment('TRACKTOTAL') || '?'),
- genre => fix ($ogg->comment('GENRE')) || '?',
+ title => $ogg->comment('TITLE') || '?',
+ artist => $ogg->comment('artist') || '?',
+ year => $ogg->comment('DATE') || '?',
+ album => $ogg->comment('ALBUM') || '?',
+ tracknumber => $ogg->comment('TRACKNUMBER') || '?',
+ tracktotal => $ogg->comment('TRACKTOTAL') || '?',
+ genre => $ogg->comment('GENRE') || '?',
file => $file,
}
}