summaryrefslogtreecommitdiff
path: root/lib/VNDB/Func.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2019-09-12 12:52:08 +0200
committerYorhel <git@yorhel.nl>2019-09-12 12:52:08 +0200
commit5d45892f95e83fc3a5185dad991bf61d9db69197 (patch)
tree5e6701fd382522da2386b440a93dd4b80bbf80cf /lib/VNDB/Func.pm
parent5a62f120bad71b81068fd1d50035effc0fda688c (diff)
VNDB::Types: Convert age_rating and release_type
Diffstat (limited to 'lib/VNDB/Func.pm')
-rw-r--r--lib/VNDB/Func.pm20
1 files changed, 3 insertions, 17 deletions
diff --git a/lib/VNDB/Func.pm b/lib/VNDB/Func.pm
index fbdf01d2..a4e6423e 100644
--- a/lib/VNDB/Func.pm
+++ b/lib/VNDB/Func.pm
@@ -11,7 +11,7 @@ use VNDBUtil;
use VNDB::Types;
use VNDB::BBCode;
our @EXPORT = (@VNDBUtil::EXPORT, 'bb2html', 'bb2text', qw|
- clearfloat cssicon tagscore mt minage fil_parse fil_serialize parenttags
+ clearfloat cssicon tagscore minage fil_parse fil_serialize parenttags
childtags charspoil imgpath imgurl
fmtvote fmtmedia fmtvnlen fmtage fmtdatestr fmtdate fmtuser fmtrating fmtspoil
json_encode json_decode script_json
@@ -67,24 +67,10 @@ sub tagscore {
}
-# short wrapper around maketext()
-sub mt {
- return $TUWF::OBJ->{l10n}->maketext(@_);
-}
-
-
sub minage {
my($a, $ex) = @_;
- my $str = $a == -1 ? 'Unknown' : !$a ? 'All ages' : sprintf '%d+', $a;
- $ex = !defined($a) ? '' : {
- 0 => 'CERO A',
- 12 => 'CERO B',
- 15 => 'CERO C',
- 17 => 'CERO D',
- 18 => 'CERO Z',
- }->{$a} if $ex;
- return $str if !$ex;
- return "$str (e.g. $ex)";
+ $a = $AGE_RATING{$a};
+ $ex && $a->{ex} ? "$a->{txt} (e.g. $a->{ex})" : $a->{txt}
}