summaryrefslogtreecommitdiff
path: root/lib/VNDB/Func.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2019-09-11 19:52:44 +0200
committerYorhel <git@yorhel.nl>2019-09-11 19:52:44 +0200
commit794806518f18bfb5470a785bb47ca799f11679b3 (patch)
tree63be39090829a890f9a95d2397d12635bcaab31b /lib/VNDB/Func.pm
parent26c2f1290468309e69d3139842481920e79cd5bc (diff)
VNDB::Types: Convert vn_lengths, anime_types and tag_categories
Diffstat (limited to 'lib/VNDB/Func.pm')
-rw-r--r--lib/VNDB/Func.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/VNDB/Func.pm b/lib/VNDB/Func.pm
index fc52ef08..fbdf01d2 100644
--- a/lib/VNDB/Func.pm
+++ b/lib/VNDB/Func.pm
@@ -8,6 +8,7 @@ use Exporter 'import';
use POSIX 'strftime', 'ceil', 'floor';
use JSON::XS;
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
@@ -219,10 +220,10 @@ sub fmtmedia {
# Formats a VN length (xtra = 1 for time indication, 2 for examples)
sub fmtvnlen {
my($len, $xtra) = @_;
- $len = $TUWF::OBJ->{vn_lengths}[$len];
- $len->[0].
- ($xtra && $xtra == 1 && $len->[1] ? " ($len->[1])" : '').
- ($xtra && $xtra == 2 && $len->[2] ? " ($len->[2])" : '');
+ $len = $VN_LENGTH{$len};
+ $len->{txt}.
+ ($xtra && $xtra == 1 && $len->{time} ? " ($len->{time})" : '').
+ ($xtra && $xtra == 2 && $len->{example} ? " ($len->{example})" : '');
}
# Formats a UNIX timestamp as a '<number> <unit> ago' string