X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/f95a0990d1d4c6e8d612c6f80accc9c0ed4e1a5e..b13bb406f89eaebf04c8fd8ffe69cde30d5aa0bd:/codec.plp?ds=inline
diff --git a/codec.plp b/codec.plp
index 5c3e572..f13b93a 100644
--- a/codec.plp
+++ b/codec.plp
@@ -4,25 +4,23 @@ my ($page, @feat) = split m{/+}, $Request || 'image';
$page !~ /\W/ or Html(), Abort('Invalid codec type request', 400);
@feat or @feat = 'default';
my $title = "$page codecs";
+my $info = eval { Data("codec-$page") };
+if ($@) {
+ $info = {};
+}
Html({
title => "$title cheat sheet",
- version => '1.0',
- description => [
- ],
- keywords => [qw'
- codec encoder encoding decode file format type mime
- feature comparison support benchmark compression
- image audio video
- '],
+ version => '1.1',
+ description => $info->{intro},
+ keywords => [@{ $info->{keywords} // [] }, qw' feature comparison support benchmark '],
stylesheet => [qw'light circus dark red'],
data => ["codec-$page.inc.pl"],
raw => '',
});
-my $info = Data("codec-$page");
-$info and %{$info} > 1
- or Abort("Requested codec type $page
not available", '404 request not found', $@ // $!);
+%{$info}
+ or Abort("Requested codec type $page
not available", '404 request not found');
say "
$_
" for $info->{intro} // ();