summaryrefslogtreecommitdiff
path: root/lib/VNDB
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2021-03-04 12:00:13 +0100
committerYorhel <git@yorhel.nl>2021-03-04 12:06:17 +0100
commit7c9e24b57a5eaa1b026833ca11cba7a451cf8556 (patch)
tree0a4ace42210152f55da88424b75c7fa688120f61 /lib/VNDB
parent5d54a844aba404e16280dcbd1ec3dffc9be4dfe1 (diff)
Releases: Store unknown minage as NULL + fix default for new entries
Fixes https://vndb.org/t950.905, which also reminded me that I can now finally store unknown as NULL rather than -1. The v2rw rewrite was preventing me from changing that earlier, handling NULLs was more annoying in the old v2 code.
Diffstat (limited to 'lib/VNDB')
-rw-r--r--lib/VNDB/Func.pm1
-rw-r--r--lib/VNDB/Types.pm3
2 files changed, 1 insertions, 3 deletions
diff --git a/lib/VNDB/Func.pm b/lib/VNDB/Func.pm
index 9e051fae..e1f6ac13 100644
--- a/lib/VNDB/Func.pm
+++ b/lib/VNDB/Func.pm
@@ -190,6 +190,7 @@ sub norm_ip {
sub minage {
my($a, $ex) = @_;
+ return 'Unknown' if !defined $a;
$a = $AGE_RATING{$a};
$ex && $a->{ex} ? "$a->{txt} (e.g. $a->{ex})" : $a->{txt}
}
diff --git a/lib/VNDB/Types.pm b/lib/VNDB/Types.pm
index 272eee8a..86cadae9 100644
--- a/lib/VNDB/Types.pm
+++ b/lib/VNDB/Types.pm
@@ -201,10 +201,7 @@ hash VOICED =>
-# TODO: For some reason the minage column in SQL is nullable but still stores 'unknown' as -1.
-# This should be cleaned up at some point.
hash AGE_RATING =>
- -1 => { txt => 'Unknown', ex => '' },
0 => { txt => 'All ages', ex => 'CERO A' },
6 => { txt => '6+', ex => '' },
7 => { txt => '7+', ex => '' },