diff options
author | Yorhel <git@yorhel.nl> | 2008-12-20 13:05:50 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2008-12-20 13:05:50 +0100 |
commit | d638ebd5dda7db506a42c26d741d710a21e19aaf (patch) | |
tree | 4e37603e8f36417c6fba8c19318c8bd74078d7a2 | |
parent | bf928c19791fd91d5d42f13a39de899fa0a4b5ca (diff) |
Fix perl warning when adding a new VN with VN relations
-rw-r--r-- | lib/VNDB/Handler/VNEdit.pm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/VNDB/Handler/VNEdit.pm b/lib/VNDB/Handler/VNEdit.pm index 14859e3a..6790ae6e 100644 --- a/lib/VNDB/Handler/VNEdit.pm +++ b/lib/VNDB/Handler/VNEdit.pm @@ -59,7 +59,7 @@ sub edit { # parse and re-sort fields that have multiple representations of the same information my $anime = [ grep /^[0-9]+$/, split /[ ,]+/, $frm->{anime} ]; my $categories = [ map { [ substr($_,0,3), substr($_,3,1) ] } split /,/, $frm->{categories} ]; - my $relations = [ map { /^([0-9]+),([0-9]+),(.+)$/ && $2 != $vid ? [ $1, $2, $3 ] : () } split /\|\|\|/, $frm->{relations} ]; + my $relations = [ map { /^([0-9]+),([0-9]+),(.+)$/ && (!$vid || $2 != $vid) ? [ $1, $2, $3 ] : () } split /\|\|\|/, $frm->{relations} ]; my $screenshots = [ map /^[0-9]+,[01],[0-9]+$/ ? [split /,/] : (), split / +/, $frm->{screenshots} ]; $frm->{anime} = join ' ', sort { $a <=> $b } @$anime; |