summaryrefslogtreecommitdiff
path: root/lib/VNDB/Func.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2019-08-09 16:53:54 +0200
committerYorhel <git@yorhel.nl>2019-08-09 16:53:56 +0200
commit414daab355c8392dc21d5623cd458426d221fedf (patch)
tree14853fa252b5130e24dcad779505f8b86b9c909b /lib/VNDB/Func.pm
parent76da9bdcf9a6492888f02457a9c7a23454da1092 (diff)
Replace Wikipedia links with Wikidata IDs
+ Automatically fetch other links from Wikidata
Diffstat (limited to 'lib/VNDB/Func.pm')
-rw-r--r--lib/VNDB/Func.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/VNDB/Func.pm b/lib/VNDB/Func.pm
index 9fe9c56c..fc52ef08 100644
--- a/lib/VNDB/Func.pm
+++ b/lib/VNDB/Func.pm
@@ -328,8 +328,10 @@ sub form_compare {
my($old, $new) = @_;
for my $k (keys %$old) {
my($o, $n) = ($old->{$k}, $new->{$k});
- return 1 if !defined $n || ref $o ne ref $n;
- if(!ref $o) {
+ return 1 if defined $n ne defined $o || ref $o ne ref $n;
+ if(!defined $o) {
+ # must be equivalent
+ } elsif(!ref $o) {
return 1 if $o ne $n;
} else { # 'json' template
return 1 if @$o != @$n;