summaryrefslogtreecommitdiff
path: root/lib/VNDB/Func.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VNDB/Func.pm')
-rw-r--r--lib/VNDB/Func.pm21
1 files changed, 3 insertions, 18 deletions
diff --git a/lib/VNDB/Func.pm b/lib/VNDB/Func.pm
index 65b66f9e..17d69cd5 100644
--- a/lib/VNDB/Func.pm
+++ b/lib/VNDB/Func.pm
@@ -7,7 +7,7 @@ use YAWF ':html';
use Exporter 'import';
use POSIX 'strftime', 'ceil', 'floor';
use VNDBUtil;
-our @EXPORT = (@VNDBUtil::EXPORT, qw| liststat clearfloat cssicon tagscore mt minage fil_parse fil_serialize |);
+our @EXPORT = (@VNDBUtil::EXPORT, qw| clearfloat cssicon tagscore mt minage fil_parse fil_serialize |);
# three ways to represent the same information
@@ -16,21 +16,6 @@ our @fil_escape = split //, $fil_escape;
our %fil_escape = map +($fil_escape[$_], sprintf '%02d', $_), 0..$#fil_escape;
-# Argument: hashref with rstat and vstat
-# Returns: empty string if not in list, otherwise colour-encoded list status
-sub liststat {
- my $l = shift;
- return '' if !$l;
- my $rs = mt('_rlst_rstat_'.$l->{rstat});
- $rs = qq|<b class="done">$rs</b>| if $l->{rstat} == 2; # Obtained
- $rs = qq|<b class="todo">$rs</b>| if $l->{rstat} < 2; # Unknown/pending
- my $vs = mt('_rlst_vstat_'.$l->{vstat});
- $vs = qq|<b class="done">$vs</b>| if $l->{vstat} == 2; # Finished
- $vs = qq|<b class="todo">$vs</b>| if $l->{vstat} == 0 || $l->{vstat} == 4; # Unknown/dropped
- return "$rs / $vs";
-}
-
-
# Clears a float, to make sure boxes always have the correct height
sub clearfloat {
div class => 'clearfloat', '';
@@ -82,7 +67,7 @@ sub mt {
sub minage {
my($a, $ex) = @_;
- my $str = !defined($a) ? mt '_minage_null' : !$a ? mt '_minage_all' : mt '_minage_age', $a;
+ my $str = $a == -1 ? mt '_minage_null' : !$a ? mt '_minage_all' : mt '_minage_age', $a;
$ex = !defined($a) ? '' : {
0 => 'CERO A',
12 => 'CERO B',
@@ -118,7 +103,7 @@ sub fil_serialize {
my @v = ref $fil->{$_} ? @{$fil->{$_}} : ($fil->{$_});
s/$e/_$fil_escape{$1}/g for(@v);
$_.'-'.join '~', @v
- } keys %$fil;
+ } grep defined($fil->{$_}), keys %$fil;
}
1;