summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-06-04 11:37:04 +0200
committerYorhel <git@yorhel.nl>2020-06-04 11:37:08 +0200
commit04c9db06ca10e7528e3969d4d6e4eef7903aecc2 (patch)
tree28b1ac1908c79bc58cff116981abbdf708dd4a74
parent50b9a5b7a59e896ed4a1f65141a31b8e64c33b55 (diff)
Hide popularity ranking for VNs without a popularity score
VNs with only lowest-vote-by-user votes will have c_votecount>0 but will not have a popularity score. May as well not display it in that case.
-rw-r--r--lib/VNWeb/VN/Page.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/VNWeb/VN/Page.pm b/lib/VNWeb/VN/Page.pm
index 6451aaf5..ba2160c1 100644
--- a/lib/VNWeb/VN/Page.pm
+++ b/lib/VNWeb/VN/Page.pm
@@ -667,7 +667,7 @@ sub stats_ {
clearfloat_;
div_ sub {
h3_ 'Ranking';
- p_ sprintf 'Popularity: ranked #%d with a score of %.2f', $rank->{c_pop_rank}, ($rank->{c_popularity}||0)*100;
+ p_ sprintf 'Popularity: ranked #%d with a score of %.2f', $rank->{c_pop_rank}, $rank->{c_popularity}*100 if defined $rank->{c_popularity};
p_ sprintf 'Bayesian rating: ranked #%d with a rating of %.2f', $rank->{c_rat_rank}, $rank->{c_rating}/10;
} if $v->{c_votecount};
}