summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2015-09-20 20:44:48 +0200
committerYorhel <git@yorhel.nl>2015-09-20 20:44:48 +0200
commit4a8c274379a5693e0d667d9011a9963319d267a2 (patch)
treeadf7416c2a2c3302263bd9c01010766c34754b1a
parented86cfd12b0bed7352e2be525b8e63cb4d6d5448 (diff)
Fix handling of empty seiyuu/credits fields
-rw-r--r--lib/VNDB/Handler/VNEdit.pm4
-rwxr-xr-xutil/vndb.pl2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/VNDB/Handler/VNEdit.pm b/lib/VNDB/Handler/VNEdit.pm
index 1883b072..4ec25605 100644
--- a/lib/VNDB/Handler/VNEdit.pm
+++ b/lib/VNDB/Handler/VNEdit.pm
@@ -117,12 +117,12 @@ sub edit {
{ post => 'anime', required => 0, default => '' },
{ post => 'image', required => 0, default => 0, template => 'id' },
{ post => 'img_nsfw', required => 0, default => 0 },
- { post => 'credits', template => 'json', json_fields => [
+ { post => 'credits', required => 0, template => 'json', json_fields => [
{ field => 'aid', required => 1, template => 'id' },
{ field => 'role', required => 1, enum => $self->{staff_roles} },
{ field => 'note', required => 0, maxlength => 250, default => '' },
]},
- { post => 'seiyuu', template => 'json', json_fields => [
+ { post => 'seiyuu', required => 0, template => 'json', json_fields => [
{ field => 'aid', required => 1, template => 'id' },
{ field => 'cid', required => 1, template => 'id' },
{ field => 'note', required => 0, maxlength => 250, default => '' },
diff --git a/util/vndb.pl b/util/vndb.pl
index fd70e564..30cdecbe 100755
--- a/util/vndb.pl
+++ b/util/vndb.pl
@@ -55,7 +55,7 @@ TUWF::set(
uname => { regex => qr/^[a-z0-9-]*$/, minlength => 2, maxlength => 15 },
gtin => { func => \&gtintype },
editsum => { maxlength => 5000, minlength => 2 },
- json => { func => \&json_validate, inherit => ['json_fields'], default => [] },
+ json => { func => \&json_validate, inherit => ['json_fields'], default => '[]' },
},
);
TUWF::load_recursive('VNDB::Util', 'VNDB::DB', 'VNDB::Handler');