summaryrefslogtreecommitdiff
path: root/lib/VNDB
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-11-14 19:04:44 +0100
committerYorhel <git@yorhel.nl>2009-11-14 19:07:55 +0100
commit7791d0236a9bcd85ea3542360b0c68a8492a909e (patch)
tree0777720f6fa5d79a68fcf1e410dd6aa454ea3f79 /lib/VNDB
parent2c6f62c89c93dbb5ec757c11f2af38534f2c760a (diff)
SQL: Allow NULL for vn.c_popularity
Sorting from least to most popular VN make sense now, you won't have to wade through those entries without any vote at all.
Diffstat (limited to 'lib/VNDB')
-rw-r--r--lib/VNDB/Handler/VNBrowse.pm4
-rw-r--r--lib/VNDB/Util/CommonHTML.pm2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/VNDB/Handler/VNBrowse.pm b/lib/VNDB/Handler/VNBrowse.pm
index 3aaa1e25..dbe80ac1 100644
--- a/lib/VNDB/Handler/VNBrowse.pm
+++ b/lib/VNDB/Handler/VNBrowse.pm
@@ -123,9 +123,9 @@ sub list {
td class => 'tc4';
lit $self->{l10n}->datestr($l->{c_released});
end;
- td class => 'tc5', sprintf '%.2f', $l->{c_popularity}*100;
+ td class => 'tc5', sprintf '%.2f', ($l->{c_popularity}||0)*100;
td class => 'tc6';
- txt sprintf '%.2f', $l->{c_rating};
+ txt sprintf '%.2f', $l->{c_rating}||0;
b class => 'grayedout', sprintf ' (%d)', $l->{c_votecount};
end;
end;
diff --git a/lib/VNDB/Util/CommonHTML.pm b/lib/VNDB/Util/CommonHTML.pm
index bb731a26..dc87d737 100644
--- a/lib/VNDB/Util/CommonHTML.pm
+++ b/lib/VNDB/Util/CommonHTML.pm
@@ -479,7 +479,7 @@ sub htmlVoteStats {
}
clearfloat;
- if($type eq 'v') {
+ if($type eq 'v' && $obj->{c_votecount}) {
div;
h3 mt '_votestats_rank_title';
p mt '_votestats_rank_pop', $obj->{p_ranking}, sprintf '%.2f', $obj->{c_popularity}*100;